Warm tip: This article is reproduced from serverfault.com, please click

Using ElaasticSearch script in the Grafana

发布于 2020-12-02 11:26:03

I’m going to use this ElasticSearch query in the Grafana:

enter image description here

But the result in Grafana is something like this:

enter image description here

How can I remove the field part in the Grfafana?

Questioner
nsafari
Viewed
11
nsafari 2020-12-07 19:46:22

I manipulated the native ElasticSearch data source plugin. Now if the field does not have value and the script has, It will only use the script in an inline tag.

enter image description here

The result is something like this:

“aggs”:{“3”:{“sum”:{“script”:{“inline”:“Double.parseDouble(doc[‘load-value’].value)”}}}}