{ "uid": "logs-homelab", "title": "Logs - Homelab", "tags": ["loki", "logs", "homelab"], "timezone": "browser", "schemaVersion": 39, "version": 1, "refresh": "30s", "templating": { "list": [ { "name": "host", "type": "query", "datasource": {"type": "loki", "uid": "loki"}, "query": "label_values(host)", "refresh": 2, "includeAll": true, "multi": false, "current": {"text": "All", "value": "$__all"} }, { "name": "job", "type": "query", "datasource": {"type": "loki", "uid": "loki"}, "query": "label_values(job)", "refresh": 2, "includeAll": true, "multi": false, "current": {"text": "All", "value": "$__all"} }, { "name": "search", "type": "textbox", "current": {"text": "", "value": ""}, "label": "Search" } ] }, "panels": [ { "id": 1, "title": "Log Volume", "type": "timeseries", "gridPos": {"h": 6, "w": 24, "x": 0, "y": 0}, "datasource": {"type": "loki", "uid": "loki"}, "targets": [ { "expr": "sum by (host) (count_over_time({host=~\"$host\", job=~\"$job\"} |~ \"$search\" [1m]))", "legendFormat": "{{host}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "short" } }, "options": { "legend": {"displayMode": "list", "placement": "bottom"} } }, { "id": 2, "title": "Logs", "type": "logs", "gridPos": {"h": 18, "w": 24, "x": 0, "y": 6}, "datasource": {"type": "loki", "uid": "loki"}, "targets": [ { "expr": "{host=~\"$host\", job=~\"$job\"} |~ \"$search\"", "refId": "A" } ], "options": { "showTime": true, "showLabels": true, "showCommonLabels": false, "wrapLogMessage": true, "prettifyLogMessage": false, "enableLogDetails": true, "sortOrder": "Descending" } } ] }