简体   繁体   English

如何使用ElasticSearch在Grafana中更改列标题

[英]How to change the columns titles In Grafana using ElasticSearch

I use Grafana to display ElasticSearch results in a table. 我使用Grafana在表中显示ElasticSearch结果。 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". 在我的情况下:我对“ upgrade_time”一词使用“平均”聚合,并根据“ db_name”一词对结果进行分组。

How can I set the column name to show "Average Upgrade Time for db1", "Average Upgrade Time for db2", etc...? 如何设置列名称以显示“ db1的平均升级时间”,“ db2的平均升级时间”等?

With ElasticSearch 6.4 and Grafana 6.2.5, the versions I am using you can use "Series naming & alias patterns" 对于ElasticSearch 6.4和Grafana 6.2.5,我正在使用的版本可以使用“系列命名和别名模式”

eg, 例如,

Lets say you display the average value of the field "upgrade time" aggregated by the term "db_name" . 假设您显示字段“ upgrade time”平均值 ,该字段由术语“ db_name”聚合。 By default, when no alias pattern is used, you will get columns titled: "db1", "db2", etc... 默认情况下,当不使用别名模式时,您将获得标题为“ db1”,“ db2”等的列。

You can then use the pattern 然后可以使用该模式

RESULT_FOR_{{db_name}} 

to change the titles to: "RESULT_FOR_db1" , "RESULT_FOR_db2", etc... 将标题更改为: “ RESULT_FOR_db1” ,“ RESULT_FOR_db2”,等等。

If you use the alias pattern 如果使用别名模式

{{metric}}

the title will be "Average" for all columns, because the calculation used is the average function 所有列的标题均为“ Average”,因为使用的计算是平均值函数

If you use {{metric}}_{{db_name}}, the titles will be: "Average_db1" , "Average_db2", etc... 如果您使用{{metric}} _ {{db_name}},则标题将为: “ Average_db1” ,“ Average_db2”,等等。

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". 标题为: “ Average_upgrade_time_db1” ,“ Average_upgrade_time_db2”等,因为汇总字段为“ upgrade_time”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Grafana中查询Elasticsearch - How to query to Elasticsearch in Grafana 如何使用Grafana从Elasticsearch中提取所有记录 - How to pull all the records from elasticsearch using Grafana 如何使用 Elasticsearch 数据源在 Grafana 中可视化百分比指标? - How to visualize a percentage metric in Grafana using Elasticsearch data source? Grafana与Elasticsearch - Grafana with Elasticsearch 如何 label x 轴上的名称以及如何在 grafana elasticsearch 的临时过滤器中相应地更改名称? - How to label the names on x-axis and also change names accordingly in ad-hoc filters in grafana elasticsearch? 为什么在硬编码时Grafana ElasticSearch查询可以工作,但是在使用Grafana变量值替换时却失败? 以及如何解决? - Why do Grafana ElasticSearch queries work when hard coded, but fail when using Grafana variable value substitution? and how to fix it? 如何从grafana的elasticsearch获取最新文档? - How to get latest doc from elasticsearch in grafana? 如何在 Grafana 中将别名模式与 ElasticSearch 一起使用? - How to use Alias pattern with ElasticSearch in Grafana? 如何使用Grafana中的Prometheus数据源监视弹性搜索 - How to monitor elasticsearch with Prometheus data source in Grafana Grafana和Elasticsearch:如何进行简单的查询 - Grafana and Elasticsearch: How to perform a simple query
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM