简体   繁体   中英

How to change the columns titles In Grafana using ElasticSearch

I use Grafana to display ElasticSearch results in a table. The table's column names are the values of the term that is the results are grouped by.

In my case: I use the Average aggregation on the term "upgrade_time" and I group the results by the term "db_name".

How can I set the column name to show "Average Upgrade Time for db1", "Average Upgrade Time for db2", etc...?

With ElasticSearch 6.4 and Grafana 6.2.5, the versions I am using you can use "Series naming & alias patterns"

eg,

Lets say you display the average value of the field "upgrade time" aggregated by the term "db_name" . By default, when no alias pattern is used, you will get columns titled: "db1", "db2", etc...

You can then use the pattern

RESULT_FOR_{{db_name}} 

to change the titles to: "RESULT_FOR_db1" , "RESULT_FOR_db2", etc...

If you use the alias pattern

{{metric}}

the title will be "Average" for all columns, because the calculation used is the average function

If you use {{metric}}_{{db_name}}, the titles will be: "Average_db1" , "Average_db2", etc...

If you use

{{metric}}_{{field}}_{{db_name}}

the titles will be: "Average_upgrade_time_db1" , "Average_upgrade_time_db2", etc..., because the aggregated field is "upgrade_time".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM