Unbound
Unbound with AD block usage
Yet another dashboard to render DNS queries and AD blocking using Unbound on OpenBSD. This dashboard is heavily inspired by projects like Pi-Hole and ADGuard.

Details are available here: https://www.tumfatig.net/2022/ads-blocking-with-openbsd-unbound8/
Unbound with AD block usage
{
  "__inputs": [
    {
      "name": "DS_COLLECTD_@ INFLUXDB",
      "label": "collectd @ InfluxDB",
      "description": "collectd metrics",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    },
    {
      "name": "DS_VARIOUS_@ INFLUXDB",
      "label": "various @ InfluxDB",
      "description": "parsed logs",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    },
    {
      "name": "VAR_FOREVER",
      "type": "constant",
      "label": "forever",
      "value": "320w",
      "description": ""
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.0.6"
    },
    {
      "type": "panel",
      "id": "grafana-piechart-panel",
      "name": "Pie Chart (old)",
      "version": "1.6.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph (old)",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Unbound with AD block usage",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "datasource": {
        "type": "influxdb",
        "uid": "000000002"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 26,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "000000002"
          },
          "refId": "A"
        }
      ],
      "title": "Service Status",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_COLLECTD_@ INFLUXDB}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(199, 208, 217)",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 0,
        "y": 1
      },
      "id": 28,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_COLLECTD_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$my_interval"
              ],
              "type": "time"
            }
          ],
          "measurement": "exec_value",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "instance",
              "operator": "=",
              "value": "unbound"
            },
            {
              "condition": "AND",
              "key": "type_instance",
              "operator": "=",
              "value": "time.up"
            }
          ]
        }
      ],
      "title": "Uptime",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_COLLECTD_@ INFLUXDB}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(199, 208, 217)",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 6,
        "y": 1
      },
      "id": 29,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_COLLECTD_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$my_interval"
              ],
              "type": "time"
            }
          ],
          "measurement": "exec_value",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "1s"
                ],
                "type": "non_negative_derivative"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "instance",
              "operator": "=",
              "value": "unbound"
            },
            {
              "condition": "AND",
              "key": "type_instance",
              "operator": "=",
              "value": "total.num.queries"
            }
          ]
        }
      ],
      "title": "Queries / sec",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_COLLECTD_@ INFLUXDB}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(199, 208, 217)",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 12,
        "y": 1
      },
      "id": 30,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_COLLECTD_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "10s"
              ],
              "type": "time"
            }
          ],
          "measurement": "exec_value",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT LAST(\"value\") FROM (SELECT sum(\"value\") AS \"value\" FROM \"exec_value\" WHERE (\"host\" =~ /^$hostname$/ AND \"instance\" = 'unbound' AND \"type_instance\" =~ /^mem.cache.*/) AND $timeFilter GROUP BY time(10s)) GROUP BY time($my_interval)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "sum"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "instance",
              "operator": "=",
              "value": "unbound"
            },
            {
              "condition": "AND",
              "key": "type_instance",
              "operator": "=~",
              "value": "/^mem.cache.*/"
            }
          ]
        }
      ],
      "title": "Memory Cache Size",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_COLLECTD_@ INFLUXDB}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(199, 208, 217)",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 18,
        "y": 1
      },
      "id": 31,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_COLLECTD_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "10s"
              ],
              "type": "time"
            }
          ],
          "measurement": "exec_value",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT LAST(\"value\") FROM (SELECT sum(\"value\") AS \"value\" FROM \"exec_value\" WHERE (\"host\" =~ /^$hostname$/ AND \"instance\" = 'unbound' AND \"type_instance\" =~ /(infra.cache.count|key.cache.count|msg.cache.count|rrset.cache.count)/) AND $timeFilter GROUP BY time(10s)) GROUP BY time($my_interval)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "sum"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "instance",
              "operator": "=",
              "value": "unbound"
            },
            {
              "condition": "AND",
              "key": "type_instance",
              "operator": "=~",
              "value": "/^mem.cache.*/"
            }
          ]
        }
      ],
      "title": "Memory Cache Items",
      "type": "stat"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "influxdb",
        "uid": "000000002"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 4
      },
      "id": 18,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "000000002"
          },
          "refId": "A"
        }
      ],
      "title": "AD blocking",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "green",
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 0,
        "y": 5
      },
      "id": 2,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [],
          "hide": false,
          "measurement": "unbound_queries",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "response_size"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "title": "Total queries",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "red",
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 6,
        "y": 5
      },
      "id": 3,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [],
          "measurement": "unbound_adblock",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT count(\"client\") FROM \"unbound_adblock\" WHERE (\"host\" =~ /^$hostname$/ AND $timeFilter)",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "matched"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "title": "Blocked queries",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "orange",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [],
          "max": 1,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 12,
        "y": 5
      },
      "id": 5,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "alias": "",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$forever"
              ],
              "type": "time"
            }
          ],
          "measurement": "unbound_queries",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT count(\"time_to_resolve\") FROM \"unbound_queries\" WHERE (\"host\" =~ /^$hostname$/ AND $timeFilter) fill(null)",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "response_size"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        },
        {
          "alias": "",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$forever"
              ],
              "type": "time"
            }
          ],
          "hide": false,
          "measurement": "unbound_adblock",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT count(\"client\") FROM \"unbound_adblock\" WHERE (\"host\" =~ /^$hostname$/ AND $timeFilter) fill(null)",
          "rawQuery": false,
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "matched"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "title": "Percent Blocked",
      "transformations": [
        {
          "id": "calculateField",
          "options": {
            "binary": {
              "left": "unbound_adblock.count",
              "operator": "/",
              "reducer": "sum",
              "right": "unbound_queries.count"
            },
            "mode": "binary",
            "reduce": {
              "include": [
                "unbound_queries.count",
                "unbound_adblock.count"
              ],
              "reducer": "diffperc"
            },
            "replaceFields": true
          }
        }
      ],
      "type": "stat"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_COLLECTD_@ INFLUXDB}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "blue",
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 18,
        "y": 5
      },
      "id": 6,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_COLLECTD_@ INFLUXDB}"
          },
          "groupBy": [],
          "hide": false,
          "measurement": "exec_value",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "instance",
              "operator": "=",
              "value": "unbound"
            },
            {
              "condition": "AND",
              "key": "type_instance",
              "operator": "=",
              "value": "num.adhosts"
            }
          ]
        }
      ],
      "title": "Domains on blocklist",
      "type": "stat"
    },
    {
      "aliasColors": {
        "Blocked": "red",
        "Blocked DNS queries": "red",
        "Permitted DNS queries": "green",
        "Queries": "green"
      },
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "description": "",
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "hiddenSeries": false,
      "id": 8,
      "legend": {
        "avg": true,
        "current": false,
        "max": false,
        "min": false,
        "show": false,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 2,
      "links": [],
      "maxDataPoints": 24,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": false
      },
      "percentage": false,
      "pluginVersion": "9.0.6",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "Permitted DNS queries",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$my_interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "unbound_queries",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT count(\"time_to_resolve\") FROM \"unbound_queries\" WHERE (\"host\" =~ /^$hostname$/ AND $timeFilter AND \"clientip\" =~ /$clientip/ AND \"clientip\" !~ /$ignore_ip/) GROUP BY time($my_interval) fill(null)",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "response_size"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        },
        {
          "alias": "Blocked DNS queries",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$my_interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "unbound_adblock",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "matched"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "DNS queries",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:731",
          "format": "locale",
          "logBase": 1,
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:732",
          "format": "short",
          "logBase": 1,
          "show": false
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "breakPoint": "50%",
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 14
      },
      "id": 15,
      "legend": {
        "show": true,
        "values": false
      },
      "legendType": "Right side",
      "links": [],
      "nullPointMode": "connected",
      "pieType": "donut",
      "pluginVersion": "7.5.11",
      "strokeWidth": 1,
      "targets": [
        {
          "alias": "$tag_type",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "type"
              ],
              "type": "tag"
            }
          ],
          "measurement": "unbound_queries",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "response_size"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "title": "Query Types",
      "type": "grafana-piechart-panel",
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "breakPoint": "50%",
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "description": "",
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 14
      },
      "id": 16,
      "legend": {
        "show": true,
        "values": false
      },
      "legendType": "Right side",
      "links": [],
      "nullPointMode": "connected",
      "pieType": "donut",
      "pluginVersion": "7.5.11",
      "strokeWidth": 1,
      "targets": [
        {
          "alias": "$tag_return_code",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "return_code"
              ],
              "type": "tag"
            }
          ],
          "measurement": "unbound_queries",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "response_size"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "title": "Reply Code",
      "type": "grafana-piechart-panel",
      "valueName": "current"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "green",
            "mode": "fixed"
          },
          "custom": {
            "displayMode": "auto",
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "name"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "DNS name"
              },
              {
                "id": "custom.align",
                "value": "left"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "count"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Queries"
              },
              {
                "id": "unit",
                "value": "short"
              },
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "custom.displayMode",
                "value": "gradient-gauge"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 22
      },
      "id": 11,
      "links": [],
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Queries"
          }
        ]
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "name"
              ],
              "type": "tag"
            }
          ],
          "hide": false,
          "measurement": "unbound_adblock",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "matched"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "title": "Top Blocked Domains",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "name",
                "count"
              ]
            }
          }
        },
        {
          "id": "merge",
          "options": {
            "reducers": []
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "green",
            "mode": "fixed"
          },
          "custom": {
            "displayMode": "auto",
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "client"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "DNS client"
              },
              {
                "id": "custom.align",
                "value": "left"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "count"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Queries"
              },
              {
                "id": "unit",
                "value": "short"
              },
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "custom.displayMode",
                "value": "gradient-gauge"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 22
      },
      "id": 19,
      "links": [],
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Queries"
          }
        ]
      },
      "pluginVersion": "9.0.6",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "client"
              ],
              "type": "tag"
            }
          ],
          "hide": false,
          "measurement": "unbound_queries",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "response_size"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "title": "Top Clients",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "count",
                "client"
              ]
            }
          }
        },
        {
          "id": "merge",
          "options": {
            "reducers": []
          }
        }
      ],
      "type": "table"
    },
    {
      "aliasColors": {
        "Blocked": "red",
        "Blocked DNS queries": "red",
        "Permitted DNS queries": "green",
        "Queries": "green"
      },
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 5,
        "w": 24,
        "x": 0,
        "y": 30
      },
      "hiddenSeries": false,
      "id": 12,
      "legend": {
        "avg": true,
        "current": false,
        "max": false,
        "min": false,
        "show": false,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "alertThreshold": false
      },
      "percentage": false,
      "pluginVersion": "7.5.11",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "Permitted DNS queries",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "unbound_queries",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT COUNT(\"count\") FROM (SELECT COUNT(\"response_size\") FROM \"unbound_queries\" WHERE (\"host\" =~ /^$hostname$/) AND $timeFilter GROUP BY time($my_interval), \"clientip\") GROUP BY time($my_interval) fill(null)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "response_size"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "Number of clients",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:731",
          "format": "locale",
          "logBase": 1,
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:732",
          "format": "short",
          "logBase": 1,
          "min": "0",
          "show": false
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "influxdb",
        "uid": "000000002"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 35
      },
      "id": 21,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "000000002"
          },
          "refId": "A"
        }
      ],
      "title": "Query Log",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_VARIOUS_@ INFLUXDB}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed"
          },
          "custom": {
            "align": "left",
            "displayMode": "auto",
            "filterable": true
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Reply"
            },
            "properties": [
              {
                "id": "unit",
                "value": "s"
              },
              {
                "id": "custom.width",
                "value": 87
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Action"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "NOERROR": {
                        "text": "Ok"
                      },
                      "NXDOMAIN": {
                        "text": "Ko"
                      },
                      "SERVFAIL": {
                        "text": "Ko"
                      }
                    },
                    "type": "value"
                  }
                ]
              },
              {
                "id": "custom.width",
                "value": 73
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Type"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 71
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "DNS query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 348
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Client"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 170
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Time"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 157
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Client IP"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 135
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "DNS Query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 232
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 16,
        "w": 24,
        "x": 0,
        "y": 36
      },
      "id": 32,
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Time"
          }
        ]
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_VARIOUS_@ INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "type"
              ],
              "type": "tag"
            },
            {
              "params": [
                "name"
              ],
              "type": "tag"
            },
            {
              "params": [
                "clientip"
              ],
              "type": "tag"
            },
            {
              "params": [
                "return_code"
              ],
              "type": "tag"
            },
            {
              "params": [
                "client"
              ],
              "type": "tag"
            }
          ],
          "hide": false,
          "measurement": "unbound_queries",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "time_to_resolve"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$hostname$/"
            }
          ]
        }
      ],
      "title": "Recent Queries",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time 2": true,
              "return_code": false
            },
            "indexByName": {
              "Time": 0,
              "client": 3,
              "clientip": 4,
              "name": 2,
              "return_code": 6,
              "time_to_resolve": 5,
              "type": 1
            },
            "renameByName": {
              "Time 1": "Time",
              "client": "Client Hostname",
              "clientip": "Client IP",
              "hostname": "Client",
              "name": "DNS Query",
              "return_code": "Action",
              "time_to_resolve": "Reply",
              "type": "Type"
            }
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 36,
  "style": "dark",
  "tags": [
    "unbound",
    "openbsd",
    "influxdb",
    "collectd"
  ],
  "templating": {
    "list": [
      {
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_VARIOUS_@ INFLUXDB}"
        },
        "definition": "SHOW TAG VALUES FROM \"unbound_queries\" WITH KEY = \"host\"",
        "hide": 0,
        "includeAll": true,
        "label": "Hostname",
        "multi": true,
        "name": "hostname",
        "options": [],
        "query": "SHOW TAG VALUES FROM \"unbound_queries\" WITH KEY = \"host\"",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "description": "Dirty hack to display total value over the whole time period \"GROUP BY time($forever)\"",
        "hide": 2,
        "name": "forever",
        "query": "${VAR_FOREVER}",
        "skipUrlSync": false,
        "type": "constant",
        "current": {
          "value": "${VAR_FOREVER}",
          "text": "${VAR_FOREVER}",
          "selected": false
        },
        "options": [
          {
            "value": "${VAR_FOREVER}",
            "text": "${VAR_FOREVER}",
            "selected": false
          }
        ]
      },
      {
        "auto": false,
        "auto_count": 30,
        "auto_min": "10s",
        "current": {
          "selected": false,
          "text": "1h",
          "value": "1h"
        },
        "description": "A list of interval value that I often use. And, it's a few to have interval appear in graph titles.",
        "hide": 0,
        "label": "Interval",
        "name": "my_interval",
        "options": [
          {
            "selected": false,
            "text": "1s",
            "value": "1s"
          },
          {
            "selected": false,
            "text": "10s",
            "value": "10s"
          },
          {
            "selected": false,
            "text": "1m",
            "value": "1m"
          },
          {
            "selected": false,
            "text": "10m",
            "value": "10m"
          },
          {
            "selected": false,
            "text": "30m",
            "value": "30m"
          },
          {
            "selected": true,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": false,
            "text": "1d",
            "value": "1d"
          },
          {
            "selected": false,
            "text": "1w",
            "value": "1w"
          },
          {
            "selected": false,
            "text": "1M",
            "value": "1M"
          },
          {
            "selected": false,
            "text": "1Y",
            "value": "1Y"
          }
        ],
        "query": "1s,10s,1m,10m,30m,1h,1d,1w,1M,1Y",
        "queryValue": "",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      }
    ]
  },
  "time": {
    "from": "now-2d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "1m",
      "10m",
      "30m"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Unbound",
  "uid": "lnjRULqmz",
  "version": 57,
  "weekStart": "",
  "gnetId": 18053
}