Influxdb tag substring

  • What Grafana version and what operating system are you using?
    v7.2.1
  • What are you trying to achieve?

I can’t find a way to cut the tag data(like MySQL’s method substring) when i use the [[tag_hostname]] in influxdb datasource.

Example: hostname like

xxx1.base.mm 1.1
xxx2.base.mm 1.2
xxx3.base.mm 1.3

Expect display:
xxx1 1.1
xxx2 1.2
xxx3 1.3

Your’s software is fantastic, I appreciate Grafana so much that no word can express this feeling.

I may not fully understand your question, but would the Alias By box help achieve what you desire?

  • Yes,i had been using the alias by, here is my alias
[[tag_hostname]]
  • here is the problem, the hostname’s length is too long, such as “bob.name.123”, “jim.name.123”. Now i just wanna display “bob” and “jim”, cut the “.name.123”, just like mysql’s function “substring”.
  • How should i solve this problem?

Hello, i have same problem. Did you solve it ?

To shorten up a long name (for example, web_server_01 to just 01), you can use an override like this:

Thank you alot grant2

This topic was automatically closed after 365 days. New replies are no longer allowed.