So was working on something for a few days and figured I would share it. For sometime I have been running a Live Logging collection flow through Node-Red. It basically connects to the websocket for Live Logging and then formats it and writes it to InfluxDB. The there is a Grafana dashboard that access that data and displays it in a way that is very consumable. This dashboard is shown below
A while back I saw the beginning of a driver that attempted to write live logging info out to a syslog Server. I have combined the two ideas and here are the results.
Here is a virtual driver that will connect to the local hub and output it's live logging to InfluxDB
Here is the JSON you can import to Grafana to create the dashboard.
{
"__inputs": [
{
"name": "DS_INFLUXDB_HUBITAT2",
"label": "InfluxDB Hubitat2",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.4.7"
},
{
"type": "panel",
"id": "graph",
"name": "Graph (old)",
"version": ""
},
{
"type": "datasource",
"id": "influxdb",
"name": "InfluxDB",
"version": "1.0.0"
},
{
"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": "Telegraf / InfluxDB / Grafana as syslog receiver",
"editable": true,
"fiscalYearStartMonth": 0,
"gnetId": 12433,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"aliasColors": {},
"bars": true,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"decimals": 0,
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 10,
"interval": "",
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"total": true,
"values": true
},
"lines": false,
"linewidth": 1,
"links": [],
"nullPointMode": "connected",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "9.4.7",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "Info",
"color": "rgb(80, 80, 80)",
"stack": "A"
},
{
"alias": "Notice",
"color": "rgb(182, 182, 182)",
"stack": "A"
},
{
"alias": "Warning",
"color": "#E0B400",
"stack": "A"
},
{
"alias": "Error",
"color": "#FF780A",
"stack": "A"
},
{
"alias": "Critical",
"color": "#E02F44",
"stack": "A"
},
{
"alias": "Alert",
"color": "#8F3BB8",
"stack": "A"
},
{
"alias": "Emergency",
"color": "#8F3BB8",
"stack": "A"
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "Info",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"groupBy": [
{
"params": [
"1m"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"measurement": "syslog",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"severity_code"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "severity",
"operator": "=",
"value": "info"
},
{
"condition": "AND",
"key": "hostname",
"operator": "=~",
"value": "/^$hostname$/"
},
{
"condition": "AND",
"key": "severity",
"operator": "=~",
"value": "/^$severity$/"
},
{
"condition": "AND",
"key": "appname",
"operator": "=~",
"value": "/^$appname$/"
},
{
"condition": "AND",
"key": "message",
"operator": "=~",
"value": "/$Query/"
}
]
},
{
"alias": "Notice",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"groupBy": [
{
"params": [
"1m"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"measurement": "syslog",
"orderByTime": "ASC",
"policy": "default",
"refId": "B",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"severity_code"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "severity",
"operator": "=",
"value": "notice"
},
{
"condition": "AND",
"key": "hostname",
"operator": "=~",
"value": "/^$hostname$/"
},
{
"condition": "AND",
"key": "severity",
"operator": "=~",
"value": "/^$severity$/"
},
{
"condition": "AND",
"key": "appname",
"operator": "=~",
"value": "/^$appname$/"
},
{
"condition": "AND",
"key": "message",
"operator": "=~",
"value": "/$Query/"
}
]
},
{
"alias": "Warning",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"groupBy": [
{
"params": [
"1m"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"measurement": "syslog",
"orderByTime": "ASC",
"policy": "default",
"refId": "D",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"severity_code"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "severity",
"operator": "=",
"value": "warning"
},
{
"condition": "AND",
"key": "hostname",
"operator": "=~",
"value": "/^$hostname$/"
},
{
"condition": "AND",
"key": "severity",
"operator": "=~",
"value": "/^$severity$/"
},
{
"condition": "AND",
"key": "appname",
"operator": "=~",
"value": "/^$appname$/"
},
{
"condition": "AND",
"key": "message",
"operator": "=~",
"value": "/$Query/"
}
]
},
{
"alias": "Error",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"groupBy": [
{
"params": [
"1m"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"measurement": "syslog",
"orderByTime": "ASC",
"policy": "default",
"refId": "C",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"severity_code"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "severity",
"operator": "=",
"value": "err"
},
{
"condition": "AND",
"key": "hostname",
"operator": "=~",
"value": "/^$hostname$/"
},
{
"condition": "AND",
"key": "severity",
"operator": "=~",
"value": "/^$severity$/"
},
{
"condition": "AND",
"key": "appname",
"operator": "=~",
"value": "/^$appname$/"
},
{
"condition": "AND",
"key": "message",
"operator": "=~",
"value": "/$Query/"
}
]
},
{
"alias": "Critical",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"groupBy": [
{
"params": [
"1m"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"measurement": "syslog",
"orderByTime": "ASC",
"policy": "default",
"refId": "E",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"severity_code"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "severity",
"operator": "=",
"value": "crit"
},
{
"condition": "AND",
"key": "hostname",
"operator": "=~",
"value": "/^$hostname$/"
},
{
"condition": "AND",
"key": "severity",
"operator": "=~",
"value": "/^$severity$/"
},
{
"condition": "AND",
"key": "appname",
"operator": "=~",
"value": "/^$appname$/"
},
{
"condition": "AND",
"key": "message",
"operator": "=~",
"value": "/$Query/"
}
]
},
{
"alias": "Alert",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"groupBy": [
{
"params": [
"1m"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"measurement": "syslog",
"orderByTime": "ASC",
"policy": "default",
"refId": "F",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"severity_code"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "severity",
"operator": "=",
"value": "alert"
},
{
"condition": "AND",
"key": "hostname",
"operator": "=~",
"value": "/^$hostname$/"
},
{
"condition": "AND",
"key": "severity",
"operator": "=~",
"value": "/^$severity$/"
},
{
"condition": "AND",
"key": "appname",
"operator": "=~",
"value": "/^$appname$/"
},
{
"condition": "AND",
"key": "message",
"operator": "=~",
"value": "/$Query/"
}
]
},
{
"alias": "Debug",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"groupBy": [
{
"params": [
"1m"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"measurement": "syslog",
"orderByTime": "ASC",
"policy": "default",
"refId": "G",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"severity_code"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "severity",
"operator": "=",
"value": "debug"
},
{
"condition": "AND",
"key": "hostname",
"operator": "=~",
"value": "/^$hostname$/"
},
{
"condition": "AND",
"key": "severity",
"operator": "=~",
"value": "/^$severity$/"
},
{
"condition": "AND",
"key": "appname",
"operator": "=~",
"value": "/^$appname$/"
},
{
"condition": "AND",
"key": "message",
"operator": "=~",
"value": "/$Query/"
}
]
}
],
"thresholds": [],
"timeRegions": [],
"title": "syslog count",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"mode": "time",
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 0,
"format": "none",
"label": "Messages / min",
"logBase": 1,
"show": true
},
{
"format": "short",
"logBase": 1,
"show": false
}
],
"yaxis": {
"align": false
}
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "left",
"cellOptions": {
"type": "auto"
},
"filterable": false,
"inspect": true
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "dark-purple",
"value": null
},
{
"color": "dark-red",
"value": 2
},
{
"color": "dark-orange",
"value": 3
},
{
"color": "dark-yellow",
"value": 4
},
{
"color": "rgb(150, 150, 150)",
"value": 5
},
{
"color": "rgb(51, 51, 51)",
"value": 6
},
{
"color": "rgb(5, 5, 5)",
"value": 7
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "severity_code"
},
"properties": [
{
"id": "mappings",
"value": [
{
"options": {
"0": {
"text": "Emergency"
},
"1": {
"text": "Alert"
},
"2": {
"text": "Critical"
},
"3": {
"text": "Error"
},
"4": {
"text": "Warning"
},
"5": {
"text": "Notice"
},
"6": {
"text": "Info"
},
"7": {
"text": "Debug"
}
},
"type": "value"
}
]
},
{
"id": "custom.cellOptions",
"value": {
"mode": "gradient",
"type": "color-background"
}
},
{
"id": "custom.width",
"value": 119
}
]
},
{
"matcher": {
"id": "byName",
"options": "Time"
},
"properties": [
{
"id": "custom.width",
"value": 163
}
]
},
{
"matcher": {
"id": "byName",
"options": "hostname"
},
"properties": [
{
"id": "custom.width",
"value": 194
}
]
},
{
"matcher": {
"id": "byName",
"options": "appname"
},
"properties": [
{
"id": "custom.width",
"value": 330
}
]
}
]
},
"gridPos": {
"h": 24,
"w": 24,
"x": 0,
"y": 7
},
"id": 12,
"options": {
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Time"
}
]
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"groupBy": [
{
"params": [
"hostname"
],
"type": "tag"
},
{
"params": [
"appname"
],
"type": "tag"
}
],
"measurement": "syslog",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
"resultFormat": "table",
"select": [
[
{
"params": [
"severity_code"
],
"type": "field"
}
],
[
{
"params": [
"message"
],
"type": "field"
}
]
],
"tags": [
{
"key": "hostname",
"operator": "=~",
"value": "/^$hostname$/"
},
{
"condition": "AND",
"key": "appname",
"operator": "=~",
"value": "/^$appname$/"
},
{
"condition": "AND",
"key": "severity",
"operator": "=~",
"value": "/^$severity$/"
},
{
"condition": "AND",
"key": "message",
"operator": "=~",
"value": "/$Query/"
}
]
}
],
"title": "Syslog Messages",
"type": "table"
}
],
"refresh": "",
"revision": 1,
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": "",
"current": {},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"definition": "SHOW TAG VALUES FROM syslog WITH KEY=appname",
"hide": 0,
"includeAll": true,
"label": "Appname",
"multi": true,
"name": "appname",
"options": [],
"query": "SHOW TAG VALUES FROM syslog WITH KEY=appname",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": "",
"current": {},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"definition": "SHOW TAG VALUES FROM syslog WITH KEY=hostname",
"hide": 0,
"includeAll": true,
"label": "Hostname",
"multi": true,
"name": "hostname",
"options": [],
"query": "SHOW TAG VALUES FROM syslog WITH KEY=hostname",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": "",
"current": {},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_HUBITAT2}"
},
"definition": "SHOW TAG VALUES FROM syslog WITH KEY=severity",
"hide": 0,
"includeAll": true,
"label": "Severity",
"multi": true,
"name": "severity",
"options": [],
"query": "SHOW TAG VALUES FROM syslog WITH KEY=severity",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {
"selected": false,
"text": "",
"value": ""
},
"description": "Querystring",
"hide": 0,
"label": "MessageQuery",
"name": "Query",
"options": [
{
"selected": true,
"text": "",
"value": ""
}
],
"query": "",
"skipUrlSync": false,
"type": "textbox"
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
" 10s",
" 30s",
" 1m",
" 5m"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "Syslog Copy Hubitat Dev",
"uid": "sa3XsKL4k",
"version": 6,
"weekStart": ""
}
This driver combined with this dashboard for Grafana will give you what you see above. You do need to have a working InfluxDB v2 instance, and use a Auth Token for access. I don't have a 1.8 version of InfluxDB anymore. The Grafana dashboard will need to be updated to point to the correct DB once installed as well. If someone wants to actively test a Influx 1.x version I can make the appropriate changes for someone to validate. Just let me know.