grafana: drop MESSAGE label after formatting log line
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m5s
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m5s
Use | drop MESSAGE to remove the extracted JSON field from labels while keeping stream labels like host visible. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -208,7 +208,7 @@
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"Done. The new configuration is\" | json | line_format \"{{.MESSAGE}}\"",
|
||||
"expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"Done. The new configuration is\" | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
@@ -231,7 +231,7 @@
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"building\" | json | line_format \"{{.MESSAGE}}\"",
|
||||
"expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"building\" | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
@@ -254,7 +254,7 @@
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "{job=\"bootstrap\", host=~\"$host\"} | json | line_format \"{{.MESSAGE}}\"",
|
||||
"expr": "{job=\"bootstrap\", host=~\"$host\"} | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
@@ -277,7 +277,7 @@
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |~ \"(?i)error|failed\" | json | line_format \"{{.MESSAGE}}\"",
|
||||
"expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |~ \"(?i)error|failed\" | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user