jsoniq VScode在sublime中删除行win + backspace行

deleteLine.json
// in settings.json
    //-------- Конфигурация редактора --------
    "macros": {
        "deleteLines": [
            //"editor.action.deleteLines",
            {"command": "type", "args": {"text": " "}},
            "cursorEnd",
            "deleteAllLeft",
            "deleteLeft"
        ]
    }, // ...

// in keybindings.json
{
    "key": "win+backspace",
    "command": "macros.deleteLines",
    "when": "editorTextFocus && !editorReadonly"
},

jsoniq jq过滤器

jqFilters.jq
/* print all the name fields in an array */
mgmt_cli -r true show simple-gateways --format json | jq .objects[].name

jsoniq 店面API

customer-data
{
  customer(customerAccessToken: "17b27e61eddfa83f1d755a6a9cf5180d") { (:Taken from customerAccessToken.accessToken:)
    orders(first: 5) {
			pageInfo{
				hasNextPage
			}
      edges {
				cursor 
        node {
          lineItems(first: 1) {
            edges {
              node {
                quantity
                title
								variant{
									id
									price
									image {
										transformedSrc
										altText
									}
                }
              }
            }
          }
        }
      }
    }
  }
}

(:
Sample products:
- A
  - wings: 4
- B
  - party: 2
  - fries: 3
- C
  - rib: 1
  - twin: 1
- D
  - nachos: 1
  - carnitas: 1
  - salad: 1
  - fogo fried chick: 1
- E
  - chicken rack: 1
  - jjampong soup: 1
  - glazed chicken fries: 1
- F
  - chicken steak: 1
  - rib: 1
  
  order arguments:
  first: Returns up to the first n elements from the list.
  last: Returns up to the last n elements from the list.
  
  sample query:
    order(first: 3)
    lineItems(first: 20) //assume max of 20 will return all items
    
  return: 
    - order A:
      - all items
    - order B:
      - all items
    - order C:
      - all items
    - and current cursor: order A
    
  response visualization:
    orders |[A] B C| D E F  
    [] - current cursor/page
    | | - array of orders returned
    
  next sample query:
    order(first: 2, after: current_cursor) current_cursor is at A
    
   return: 
    - order B:
      - all items
    - order C:
      - all items
    - and current_cursor: order B
    
  response visualization:
    orders A |[B] C| D E F
    
  next sample query:
    order(first: 3, after: current_cursor) current_cursor is at B
  
 return: 
  - order C:
    - all items
  - order D:
    - all items
  - order E:
    - all items
  - and current_cursor: order C
    
  response visualization:
    orders A B |[C] D E| F
    
  next sample query:
    order(last: 2, before: current_cursor) current_cursor is at C
  
 return: 
  - order B:
    - all items
  - order C:
    - all items
  - and current_cursor: order F
    
  response visualization:
    orders |[A] B| C D E F

  
customer-access-token
mutation customerAccessTokenCreate($input: CustomerAccessTokenCreateInput!) {
  customerAccessTokenCreate(input: $input) {
    customerAccessToken {
      accessToken 
      expiresAt
    }
    customerUserErrors {
      field
      message
    }
  }
}

jsoniq getUpdatesResponse.jq

getUpdatesResponse.jq

getUpdatesResponse.jq
{
    "ok": true,
    "result": [
        {
            "update_id": 637948249,
            "channel_post": {
                "message_id": 23,
                "chat": {
                    "id": -1001130518235,
                    "title": "wbztestchannel",
                    "type": "channel"
                },
                "date": 1502830344,
                "text": "тест"
            }
        },
        {
            "update_id": 637948250,
            "channel_post": {
                "message_id": 24,
                "chat": {
                    "id": -1001130518235,
                    "title": "wbztestchannel",
                    "type": "channel"
                },
                "date": 1502830816,
                "text": "тест опять"
            }
        }
    ]
}

jsoniq Sublime Text 3设置

Sublime Text 3设置

default.jq
{
	"auto_match_enabled": false,
	"bold_folder_labels": true,
	"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
	"enable_tab_scrolling": false,
	"ensure_newline_at_eof_on_save": true,
	"folder_exclude_patterns":
	[
		"coverage",
		".git",
		".bundle",
		".direnv",
		"node_modules"
	],
	"font_face": "Consolas",
	"font_options":
	[
	],
	"font_size": 12,
	"highlight_line": true,
	"highlight_modified_tabs": true,
	"ignored_packages":
	[
		"Vintage"
	],
	"line_padding_bottom": 3,
	"line_padding_top": 3,
	"margin": 2,
	"material_theme_compact_sidebar": true,
	"material_theme_small_statusbar": true,
	"material_theme_small_tab": true,
	"rulers":
	[
		80
	],
	"show_encoding": true,
	"show_line_endings": true,
	"tab_size": 2,
	"theme": "Material-Theme-Darker.sublime-theme",
	"translate_tabs_to_spaces": true,
	"trim_trailing_white_space_on_save": true,
	"word_wrap": false
}

jsoniq Grafana我的仪表板

Grafana我的仪表板

GrafanaMyDashboard.jq
{
  "__inputs": [
    {
      "name": "DS_INFLUX",
      "label": "Influx",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "4.1.1"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    }
  ],
  "annotations": {
    "list": []
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "hideControls": false,
  "id": null,
  "links": [],
  "refresh": "10s",
  "rows": [
    {
      "collapse": false,
      "height": 266,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_INFLUX}",
          "fill": 0,
          "id": 1,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "minSpan": null,
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "Elasticsearch",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "auto"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "autogen",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "elasticsearch"
                }
              ]
            },
            {
              "alias": "cAdvisor",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "cadvisor"
                }
              ]
            },
            {
              "alias": "Grafana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "grafana"
                }
              ]
            },
            {
              "alias": "Kibana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "kibana"
                }
              ]
            },
            {
              "alias": "Apache 2",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_apache2_1"
                }
              ]
            },
            {
              "alias": "MySQL",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_mysql_1"
                }
              ]
            },
            {
              "alias": "PHP7",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_php-fpm_1"
                }
              ]
            },
            {
              "alias": "Influx",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "H",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "influxdb"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Memory Usage (Mean)",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "bytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 283,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_INFLUX}",
          "fill": 1,
          "id": 5,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "alias": "Elasticsearch",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "elasticsearch"
                }
              ]
            },
            {
              "alias": "cAdvisor",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "cadvisor"
                }
              ]
            },
            {
              "alias": "Grafana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "grafana"
                }
              ]
            },
            {
              "alias": "Apache 2",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_apache2_1"
                }
              ]
            },
            {
              "alias": "MySQL",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_mysql_1"
                }
              ]
            },
            {
              "alias": "PHP7",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_php-fpm_1"
                }
              ]
            },
            {
              "alias": "Influx",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "influxdb"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Mean Disk Usage",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "decbits",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "decbytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 277,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_INFLUX}",
          "fill": 1,
          "id": 7,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "Elasticsearch",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "elasticsearch"
                }
              ]
            },
            {
              "alias": "cAdvisor",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "cadvisor"
                }
              ]
            },
            {
              "alias": "Grafana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "grafana"
                }
              ]
            },
            {
              "alias": "Kibana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "kibana"
                }
              ]
            },
            {
              "alias": "Apache 2",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_apache2_1"
                }
              ]
            },
            {
              "alias": "MySQL",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_mysql_1"
                }
              ]
            },
            {
              "alias": "PHP 7",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_php-fpm_1"
                }
              ]
            },
            {
              "alias": "Influx",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "H",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "influxdb"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Network Throughput",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "bytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "bps",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 264,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_INFLUX}",
          "fill": 1,
          "id": 2,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "Elasticsearch",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "elasticsearch"
                }
              ]
            },
            {
              "alias": "cAdvisor",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "cadvisor"
                }
              ]
            },
            {
              "alias": "Grafana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "grafana"
                }
              ]
            },
            {
              "alias": "Kibana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "kibana"
                }
              ]
            },
            {
              "alias": "Apache 2",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_apache2_1"
                }
              ]
            },
            {
              "alias": "MySQL",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_mysql_1"
                }
              ]
            },
            {
              "alias": "PHP 7",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_php-fpm_1"
                }
              ]
            },
            {
              "alias": "Influx",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "H",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "influxdb"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "CPU Usage (Total)",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "hertz",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "hertz",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 250,
      "panels": [
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "datasource": "${DS_INFLUX}",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 6,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 12,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [
            {
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_errors",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "sum"
                  }
                ]
              ],
              "tags": []
            }
          ],
          "thresholds": "",
          "title": "Tx Errors",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "total"
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    }
  ],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Container Metrics",
  "version": 44
}

jsoniq Grafana我的仪表板

Grafana我的仪表板

GrafanaMyDashboard.jq
{
  "__inputs": [
    {
      "name": "DS_INFLUX",
      "label": "Influx",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "4.1.1"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    }
  ],
  "annotations": {
    "list": []
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "hideControls": false,
  "id": null,
  "links": [],
  "refresh": "10s",
  "rows": [
    {
      "collapse": false,
      "height": 266,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_INFLUX}",
          "fill": 0,
          "id": 1,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "minSpan": null,
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "Elasticsearch",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "auto"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "autogen",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "elasticsearch"
                }
              ]
            },
            {
              "alias": "cAdvisor",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "cadvisor"
                }
              ]
            },
            {
              "alias": "Grafana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "grafana"
                }
              ]
            },
            {
              "alias": "Kibana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "kibana"
                }
              ]
            },
            {
              "alias": "Apache 2",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_apache2_1"
                }
              ]
            },
            {
              "alias": "MySQL",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_mysql_1"
                }
              ]
            },
            {
              "alias": "PHP7",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_php-fpm_1"
                }
              ]
            },
            {
              "alias": "Influx",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "memory_usage",
              "policy": "default",
              "refId": "H",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "influxdb"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Memory Usage (Mean)",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "bytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 283,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_INFLUX}",
          "fill": 1,
          "id": 5,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "alias": "Elasticsearch",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "elasticsearch"
                }
              ]
            },
            {
              "alias": "cAdvisor",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "cadvisor"
                }
              ]
            },
            {
              "alias": "Grafana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "grafana"
                }
              ]
            },
            {
              "alias": "Apache 2",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_apache2_1"
                }
              ]
            },
            {
              "alias": "MySQL",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_mysql_1"
                }
              ]
            },
            {
              "alias": "PHP7",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_php-fpm_1"
                }
              ]
            },
            {
              "alias": "Influx",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "fs_usage",
              "policy": "default",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "influxdb"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Mean Disk Usage",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "decbits",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "decbytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 277,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_INFLUX}",
          "fill": 1,
          "id": 7,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "Elasticsearch",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "elasticsearch"
                }
              ]
            },
            {
              "alias": "cAdvisor",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "cadvisor"
                }
              ]
            },
            {
              "alias": "Grafana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "grafana"
                }
              ]
            },
            {
              "alias": "Kibana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "kibana"
                }
              ]
            },
            {
              "alias": "Apache 2",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_apache2_1"
                }
              ]
            },
            {
              "alias": "MySQL",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_mysql_1"
                }
              ]
            },
            {
              "alias": "PHP 7",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_php-fpm_1"
                }
              ]
            },
            {
              "alias": "Influx",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_bytes",
              "policy": "default",
              "refId": "H",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "influxdb"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Network Throughput",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "bytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "bps",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 264,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_INFLUX}",
          "fill": 1,
          "id": 2,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "Elasticsearch",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "elasticsearch"
                }
              ]
            },
            {
              "alias": "cAdvisor",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "cadvisor"
                }
              ]
            },
            {
              "alias": "Grafana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "grafana"
                }
              ]
            },
            {
              "alias": "Kibana",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "kibana"
                }
              ]
            },
            {
              "alias": "Apache 2",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_apache2_1"
                }
              ]
            },
            {
              "alias": "MySQL",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_mysql_1"
                }
              ]
            },
            {
              "alias": "PHP 7",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "laradock_php-fpm_1"
                }
              ]
            },
            {
              "alias": "Influx",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "linear"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "cpu_usage_total",
              "policy": "default",
              "refId": "H",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "container_name",
                  "operator": "=",
                  "value": "influxdb"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "CPU Usage (Total)",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "hertz",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "hertz",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 250,
      "panels": [
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "datasource": "${DS_INFLUX}",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 6,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 12,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [
            {
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "tx_errors",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "sum"
                  }
                ]
              ],
              "tags": []
            }
          ],
          "thresholds": "",
          "title": "Tx Errors",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "total"
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    }
  ],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Container Metrics",
  "version": 44
}

jsoniq 适用于journalctl的JSON jq魔术。 https://blog.kylemanna.com/linux/systemd-journalctl-sort-by-frequency

适用于journalctl的JSON jq魔术。 https://blog.kylemanna.com/linux/systemd-journalctl-sort-by-frequency

journalctl-sort-by-program-frequency.jq
#
# Read from journalctl outputting json and sort the data by program frequency
#
# https://blog.kylemanna.com/linux/systemd-journalctl-sort-by-frequency
#
# Author: Kyle Manna
#
# invocation: journalctl -o json --since "1 month ago" | jq -s -f systemd-journalctl-sort-by-program-frequency.jq
#

# Grab the most useful name and a pointer/cursor to each occurrence
[.[] | { name: (if .SYSLOG_IDENTIFIER then .SYSLOG_IDENTIFIER else ._COMM end), cursor:.__CURSOR }] 

# Group by name
| group_by(.name)

# Collapse the grouping in to a simple { name: $NAME, length: XX } object
| map({name: .[0].name, length: [.[].cursor] | length})

# Sort by length
| sort_by(.length)

jsoniq Sublime Text 3的自定义键绑定

Sublime Text 3的自定义键绑定

Default (Windows).sulbime-keymap.jq
[
	//Indent code -- http://stackoverflow.com/questions/8839753/formatting-html-code-using-sublime-text-2
	{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": {"single_line": false}},
	{ "keys": ["ctrl+k", "ctrl+t"], "command": "title_case" },
	//Bring back the Quick Switch Project prompt
	{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" },
	//Save and Build HTML from Markdown at the same time
	{ "keys": ["ctrl+s"], "command": "build" }
]

jsoniq Sublime文本配置文件

Sublime文本配置文件

description.md
Sublime Text Configuration File
----

* Soda Theme: http://buymeasoda.github.io/soda-theme/
* Try a theme before installing it: http://colorsublime.com/
Preferences.sublime-settings.jq
{
	"always_show_minimap_viewport": true,
	"caret_style": "phase",
	"color_scheme": "Packages/User/SublimeLinter/Monokai Bright (SL).tmTheme",
	"copy_with_empty_selection": false,
	"draw_minimap_border": false,
	"save_on_focus_lost": true,
	"font_options":
	[
		"directwrite"
	],
	"font_size": 11,
	"highlight_line": true,
	"ignored_packages":
	[
		"Vintage"
	],
	"indent_guide_options":
	[
		"draw_normal",
		"draw_active"
	],
	"tab_size": 4,
	"theme": "Cobalt2.sublime-theme",
	"trim_trailing_white_space_on_save": true,
	"spell_check": true,
	"dictionary": "Packages/Language - English/en_US.dic"
}