Grafana dashboard: FastNetMon source ASN report
Description: FastNetMon source ASN report


{
  "__inputs": [
    {
      "name": "DS_CLICKHOUSE",
      "label": "Clickhouse",
      "description": "",
      "type": "datasource",
      "pluginId": "vertamedia-clickhouse-datasource",
      "pluginName": "ClickHouse"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "4.2.0"
    },
    {
      "type": "panel",
      "id": "grafana-piechart-panel",
      "name": "Pie Chart",
      "version": "1.1.4"
    },
    {
      "type": "datasource",
      "id": "vertamedia-clickhouse-datasource",
      "name": "ClickHouse",
      "version": "0.0.1"
    }
  ],
  "annotations": {
    "list": []
  },
  "editable": true,
  "gnetId": 2107,
  "graphTooltip": 0,
  "hideControls": false,
  "id": null,
  "links": [],
  "rows": [
    {
      "collapse": false,
      "height": "250px",
      "panels": [
        {
          "aliasColors": {},
          "cacheTimeout": null,
          "combine": {
            "label": "Others",
            "threshold": 0
          },
          "datasource": "${DS_CLICKHOUSE}",
          "fontSize": "80%",
          "format": "short",
          "id": 1,
          "interval": null,
          "legend": {
            "show": true,
            "sortDesc": true,
            "values": true
          },
          "legendType": "Under graph",
          "links": [],
          "maxDataPoints": 3,
          "nullPointMode": "connected",
          "pieType": "pie",
          "span": 12,
          "strokeWidth": 1,
          "targets": [
            {
              "database": "fastnetmon",
              "dateColDataType": "packetDate",
              "dateLoading": false,
              "dateTimeColDataType": "packetDateTime",
              "datetimeLoading": false,
              "formattedQuery": "<font color=\"darkcyan\">$columns</font>(<br />    srcAsn c,<br />    <font color=\"navajowhite\">sum</font>(<font color=\"navajowhite\">length</font>) <font color=\"navajowhite\">length</font>)<br /><font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br /><font color=\"darkorange\">WHERE</font> srcAsn <font color=\"darkorange\">in</font> (<br />    <font color=\"darkorange\">SELECT</font> srcAsn<br />    <font color=\"darkorange\">FROM</font><br />(<br />        <font color=\"darkorange\">SELECT</font><br />            srcAsn,<br />            <font color=\"navajowhite\">sum</font>(<font color=\"navajowhite\">length</font>) <font color=\"darkorange\">as</font> <font color=\"navajowhite\">length</font><br />        <font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br />        <font color=\"darkorange\">GROUP BY</font> srcAsn<br />        <font color=\"darkorange\">ORDER BY</font> <font color=\"navajowhite\">length</font> <font color=\"darkorange\">DESC</font><br />        <font color=\"darkorange\">LIMIT</font> <font color=\"cornflowerblue\">20</font><br />))",
              "intervalFactor": 1,
              "query": "$columns(\n    srcAsn c,\n    sum(length) length)\nFROM $table\nWHERE srcAsn in (\n    SELECT srcAsn\n    FROM\n(\n        SELECT\n            srcAsn,\n            sum(length) as length\n        FROM $table\n        GROUP BY srcAsn\n        ORDER BY length DESC\n        LIMIT 20\n))",
              "rawQuery": "SELECT t, groupArray((c, length)) as groupArr FROM ( SELECT (intDiv(toUInt32(packetDateTime), 21600) * 21600) * 1000 as t, srcAsn c, \n    sum(length) length FROM fastnetmon.traffic\nWHERE packetDate >= toDate(1491839126) AND packetDateTime >= toDateTime(1491839126) AND  srcAsn in (\n    SELECT srcAsn\n    FROM\n(\n        SELECT\n            srcAsn,\n            sum(length) as length\n        FROM fastnetmon.traffic\n        GROUP BY srcAsn\n        ORDER BY length DESC\n        LIMIT 20\n)) GROUP BY t, c  ORDER BY t, c) GROUP BY t ORDER BY t ",
              "refId": "A",
              "resultFormat": "time_series",
              "table": "traffic",
              "tableLoading": false,
              "tags": [],
              "targetLists": [
                [
                  {
                    "params": [
                      "*"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "count"
                  }
                ]
              ]
            }
          ],
          "title": "Source ASN report",
          "type": "grafana-piechart-panel",
          "valueName": "current"
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 250,
      "panels": [],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    }
  ],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-24h",
    "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": "FastNetMon source ASN report",
  "version": 7,
  "description": "FastNetMon source ASN report"
}