Howto relable tooltip and legend names

Hi,

I have a “homey” smart home witch logs to a syslog-ng container running inside my docker.
I have all though a loki and grafan container running.

I would like to have the legend and tooltip names replaced with the corresponding app-names

For example this one

"labels": {
                    "application": "BAD_LICHT",
                    "facility": "local1",
                    "host": "homey-62456552d237d50bb470c7ef-4",
                    "job": "syslog",
                    "level": "debug",
                    "proc_id": "2327"
                  },
                  "config": {
                    "displayNameFromDS": "homey-62456552d237d50bb470c7ef-4"
                  }

should than be called “BAD”

Here is the result of my query inspection

Thank you!

{
  "request": {
    "url": "api/ds/query?ds_type=loki&requestId=Q259_1",
    "method": "POST",
    "data": {
      "queries": [
        {
          "datasource": {
            "type": "loki",
            "uid": "P8E80F9AEF21F6940"
          },
          "editorMode": "builder",
          "expr": "count_over_time({job=\"syslog\", host=~\"homey-62456552d237d50bb470c7ef-4\", level=~\"debug|informational|notice|warning|error|critical|alert|emergency\", application=~\".*\"} !~ `.*$ignore_lines_with.*` |~ `.*.*` [$__interval])",
          "legendFormat": "{{host}}",
          "queryType": "range",
          "refId": "A",
          "datasourceId": 3,
          "intervalMs": 60000,
          "maxDataPoints": 1028
        }
      ],
      "from": "1726729080000",
      "to": "1726750723219"
    },
    "hideFromInspector": false
  },
  "response": {
    "results": {
      "A": {
        "status": 200,
        "frames": [
          {
            "schema": {
              "refId": "A",
              "meta": {
                "type": "timeseries-multi",
                "typeVersion": [
                  0,
                  1
                ],
                "stats": [
                  {
                    "displayName": "Summary: bytes processed per second",
                    "unit": "Bps",
                    "value": 78507
                  },
                  {
                    "displayName": "Summary: lines processed per second",
                    "value": 1407
                  },
                  {
                    "displayName": "Summary: total bytes processed",
                    "unit": "decbytes",
                    "value": 7418
                  },
                  {
                    "displayName": "Summary: total lines processed",
                    "value": 133
                  },
                  {
                    "displayName": "Summary: exec time",
                    "unit": "s",
                    "value": 0.094487879
                  },
                  {
                    "displayName": "Ingester: total reached",
                    "value": 11
                  },
                  {
                    "displayName": "Ingester: total chunks matched",
                    "value": 5
                  },
                  {
                    "displayName": "Ingester: total batches",
                    "value": 22
                  },
                  {
                    "displayName": "Ingester: total lines sent",
                    "value": 37
                  },
                  {
                    "displayName": "Ingester: head chunk bytes",
                    "unit": "decbytes",
                    "value": 0
                  },
                  {
                    "displayName": "Ingester: head chunk lines",
                    "value": 0
                  },
                  {
                    "displayName": "Ingester: decompressed bytes",
                    "unit": "decbytes",
                    "value": 0
                  },
                  {
                    "displayName": "Ingester: decompressed lines",
                    "value": 0
                  },
                  {
                    "displayName": "Ingester: compressed bytes",
                    "unit": "decbytes",
                    "value": 0
                  },
                  {
                    "displayName": "Ingester: total duplicates",
                    "value": 0
                  }
                ],
                "executedQueryString": "Expr: count_over_time({job=\"syslog\", host=~\"homey-62456552d237d50bb470c7ef-4\", level=~\"debug|informational|notice|warning|error|critical|alert|emergency\", application=~\".*\"} !~ `.*$ignore_lines_with.*` |~ `.*.*` [1m])\nStep: 1m0s"
              },
              "fields": [
                {
                  "name": "Time",
                  "type": "time",
                  "typeInfo": {
                    "frame": "time.Time"
                  },
                  "config": {
                    "interval": 60000
                  }
                },
                {
                  "name": "Value",
                  "type": "number",
                  "typeInfo": {
                    "frame": "float64"
                  },
                  "labels": {
                    "application": "BAD",
                    "facility": "local1",
                    "host": "homey-62456552d237d50bb470c7ef-4",
                    "job": "syslog",
                    "level": "debug",
                    "proc_id": "2327"
                  },
                  "config": {
                    "displayNameFromDS": "homey-62456552d237d50bb470c7ef-4"
                  }
                }
              ]
            },
            "data": {
              "values": [
                [
                  1726730220000,
                  1726731420000,
                  1726732620000,
                  1726733820000,
                  1726735020000,
                  1726736220000,
                  1726745760000,
                  1726746960000,
                  1726748160000,
                  1726750560000
                ],
                [
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1
                ]
              ]
            }
          },
          {
            "schema": {
              "refId": "A",
              "meta": {
                "type": "timeseries-multi",
                "typeVersion": [
                  0,
                  1
                ],
                "executedQueryString": "Expr: count_over_time({job=\"syslog\", host=~\"homey-62456552d237d50bb470c7ef-4\", level=~\"debug|informational|notice|warning|error|critical|alert|emergency\", application=~\".*\"} !~ `.*$ignore_lines_with.*` |~ `.*.*` [1m])\nStep: 1m0s"
              },
              "fields": [
                {
                  "name": "Time",
                  "type": "time",
                  "typeInfo": {
                    "frame": "time.Time"
                  },
                  "config": {
                    "interval": 60000
                  }
                },
                {
                  "name": "Value",
                  "type": "number",
                  "typeInfo": {
                    "frame": "float64"
                  },
                  "labels": {
                    "application": "BAD_FENSTER",
                    "facility": "local1",
                    "host": "homey-62456552d237d50bb470c7ef-4",
                    "job": "syslog",
                    "level": "informational",
                    "proc_id": "2327"
                  },
                  "config": {
                    "displayNameFromDS": "homey-62456552d237d50bb470c7ef-4"
                  }
                }
              ]
            },
            "data": {
              "values": [
                [
                  1726740600000,
                  1726744560000
                ],
                [
                  1,
                  1
                ]
              ]
            }
          },
          {
            "schema": {
              "refId": "A",
              "meta": {
                "type": "timeseries-multi",
                "typeVersion": [
                  0,
                  1
                ],
                "executedQueryString": "Expr: count_over_time({job=\"syslog\", host=~\"homey-62456552d237d50bb470c7ef-4\", level=~\"debug|informational|notice|warning|error|critical|alert|emergency\", application=~\".*\"} !~ `.*$ignore_lines_with.*` |~ `.*.*` [1m])\nStep: 1m0s"
              },
              "fields": [
                {
                  "name": "Time",
                  "type": "time",
                  "typeInfo": {
                    "frame": "time.Time"
                  },
                  "config": {
                    "interval": 60000
                  }
                },
                {
                  "name": "Value",
                  "type": "number",
                  "typeInfo": {
                    "frame": "float64"
                  },
                  "labels": {
                    "application": "BAD_LICHT",
                    "facility": "local1",
                    "host": "homey-62456552d237d50bb470c7ef-4",
                    "job": "syslog",
                    "level": "debug",
                    "proc_id": "2327"
                  },
                  "config": {
                    "displayNameFromDS": "homey-62456552d237d50bb470c7ef-4"
                  }
                }
              ]
            },
            "data": {
              "values": [
                [
                  1726730220000,
                  1726731420000,
                  1726732620000,
                  1726733820000,
                  1726735020000,
                  1726736220000,
                  1726745760000,
                  1726746960000,
                  1726748160000,
                  1726750560000
                ],
                [
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1
                ]
              ]
            }
          },
          {
            "schema": {
              "refId": "A",
              "meta": {
                "type": "timeseries-multi",
                "typeVersion": [
                  0,
                  1
                ],
                "executedQueryString": "Expr: count_over_time({job=\"syslog\", host=~\"homey-62456552d237d50bb470c7ef-4\", level=~\"debug|informational|notice|warning|error|critical|alert|emergency\", application=~\".*\"} !~ `.*$ignore_lines_with.*` |~ `.*.*` [1m])\nStep: 1m0s"
              },
              "fields": [
                {
                  "name": "Time",
                  "type": "time",
                  "typeInfo": {
                    "frame": "time.Time"
                  },
                  "config": {
                    "interval": 60000
                  }
                },
                {
                  "name": "Value",
                  "type": "number",
                  "typeInfo": {
                    "frame": "float64"
                  },
                  "labels": {
                    "application": "HAC",
                    "facility": "user",
                    "host": "homey-62456552d237d50bb470c7ef-4",
                    "job": "syslog",
                    "level": "informational",
                    "proc_id": "2327"
                  },
                  "config": {
                    "displayNameFromDS": "homey-62456552d237d50bb470c7ef-4"
                  }
                }
              ]
            },
            "data": {
              "values": [
                [
                  1726729260000,
                  1726732860000,
                  1726736460000,
                  1726740060000,
                  1726743660000,
                  1726747260000
                ],
                [
                  1,
                  1,
                  1,
                  1,
                  1,
                  1
                ]
              ]
            }
          },
          {
            "schema": {
              "refId": "A",
              "meta": {
                "type": "timeseries-multi",
                "typeVersion": [
                  0,
                  1
                ],
                "executedQueryString": "Expr: count_over_time({job=\"syslog\", host=~\"homey-62456552d237d50bb470c7ef-4\", level=~\"debug|informational|notice|warning|error|critical|alert|emergency\", application=~\".*\"} !~ `.*$ignore_lines_with.*` |~ `.*.*` [1m])\nStep: 1m0s"
              },
              "fields": [
                {
                  "name": "Time",
                  "type": "time",
                  "typeInfo": {
                    "frame": "time.Time"
                  },
                  "config": {
                    "interval": 60000
                  }
                },
                {
                  "name": "Value",
                  "type": "number",
                  "typeInfo": {
                    "frame": "float64"
                  },
                  "labels": {
                    "application": "SYSTEM",
                    "facility": "daemon",
                    "host": "homey-62456552d237d50bb470c7ef-4",
                    "job": "syslog",
                    "level": "debug",
                    "proc_id": "2327"
                  },
                  "config": {
                    "displayNameFromDS": "homey-62456552d237d50bb470c7ef-4"
                  }
                }
              ]
            },
            "data": {
              "values": [
                [
                  1726740060000
                ],
                [
                  1
                ]
              ]
            }
          },
          {
            "schema": {
              "refId": "A",
              "meta": {
                "type": "timeseries-multi",
                "typeVersion": [
                  0,
                  1
                ],
                "executedQueryString": "Expr: count_over_time({job=\"syslog\", host=~\"homey-62456552d237d50bb470c7ef-4\", level=~\"debug|informational|notice|warning|error|critical|alert|emergency\", application=~\".*\"} !~ `.*$ignore_lines_with.*` |~ `.*.*` [1m])\nStep: 1m0s"
              },
              "fields": [
                {
                  "name": "Time",
                  "type": "time",
                  "typeInfo": {
                    "frame": "time.Time"
                  },
                  "config": {
                    "interval": 60000
                  }
                },
                {
                  "name": "Value",
                  "type": "number",
                  "typeInfo": {
                    "frame": "float64"
                  },
                  "labels": {
                    "application": "SZ1_FENSTER",
                    "facility": "local1",
                    "host": "homey-62456552d237d50bb470c7ef-4",
                    "job": "syslog",
                    "level": "debug",
                    "proc_id": "2327"
                  },
                  "config": {
                    "displayNameFromDS": "homey-62456552d237d50bb470c7ef-4"
                  }
                }
              ]
            },
            "data": {
              "values": [
                [
                  1726729140000,
                  1726731000000,
                  1726742340000,
                  1726743060000,
                  1726748340000,
                  1726750260000
                ],
                [
                  1,
                  1,
                  1,
                  1,
                  1,
                  1
                ]
              ]
            }
          },
          {
            "schema": {
              "refId": "A",
              "meta": {
                "type": "timeseries-multi",
                "typeVersion": [
                  0,
                  1
                ],
                "executedQueryString": "Expr: count_over_time({job=\"syslog\", host=~\"homey-62456552d237d50bb470c7ef-4\", level=~\"debug|informational|notice|warning|error|critical|alert|emergency\", application=~\".*\"} !~ `.*$ignore_lines_with.*` |~ `.*.*` [1m])\nStep: 1m0s"
              },
              "fields": [
                {
                  "name": "Time",
                  "type": "time",
                  "typeInfo": {
                    "frame": "time.Time"
                  },
                  "config": {
                    "interval": 60000
                  }
                },
                {
                  "name": "Value",
                  "type": "number",
                  "typeInfo": {
                    "frame": "float64"
                  },
                  "labels": {
                    "application": "SZ1_LICHT",
                    "facility": "local1",
                    "host": "homey-62456552d237d50bb470c7ef-4",
                    "job": "syslog",
                    "level": "debug",
                    "proc_id": "2327"
                  },
                  "config": {
                    "displayNameFromDS": "homey-62456552d237d50bb470c7ef-4"
                  }
                }
              ]
            },
            "data": {
              "values": [
                [
                  1726729140000,
                  1726731120000,
                  1726741260000,
                  1726741320000,
                  1726741980000,
                  1726746960000,
                  1726747140000,
                  1726747380000,
                  1726747440000,
                  1726749780000,
                  1726749840000,
                  1726749900000,
                  1726750260000,
                  1726750320000,
                  1726750380000,
                  1726750500000,
                  1726750680000
                ],
                [
                  1,
                  1,
                  2,
                  2,
                  2,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  2,
                  1,
                  1,
                  3,
                  1,
                  2
                ]
              ]
            }
          }
        ],
        "refId": "A"
      }
    }
  }
}