[英]Grafana - cast elastic string value to
I would like to graph values from elasticsearch with grafana. 我想用grafana绘制来自elasticsearch的值。 The problem is that the value is stored as string: 问题在于该值存储为字符串:
[
{"timestamp": 123123123123,
"value": "12"},
{"timestamp": 123123123123,
"value": "14"}
]
When I then select metric in grafana 'Max', there is no value shown. 当我在grafana'Max'中选择指标时,没有显示任何值。
I tried in the metric
-> options
to set script to parseInt(_value)
which does not help 我尝试在metric
-> options
中将脚本设置为parseInt(_value)
这无济于事
It is not possible on the Grafana or Elasticsearch level . 在Grafana或Elasticsearch级别上是不可能的。 Fix your ES field mapping ( double
datatype for value
field) https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html and you will receive correct format for Grafana directly from ES. 修复您的ES字段映射( value
字段为double
数据类型) https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html ,您将直接从ES收到Grafana的正确格式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.