Using ElaasticSearch script in the Grafana

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

But the result in Grafana is something like this:

How can I remove the field part completely?

What is the query in Grafana Query?

There is the query:


Which is created by this configuration:

What you want to achieve with that script?
Because the script field in the metric, just do aritmatic calculation from the metric value, such as, _value * 10

I want to parse a value with keyword type to double.

Need more information about the data that you stored in the elasticsearch. You can paste here with removing sensitive data, also what format to display do you need with the value inside the index.

There is a sample data:
“from-date”: “2020-05-10T23:00:00+02:00”,
“until-date”: “2020-05-10T23:15:00+02:00”,
“load-value”: 37500,

There is the mapping:
“from-date”: {
“type”: “date”
“until-date”: {
“type”: “date”
“load-value”: {
“type”: “keyword”

I want to create sum aggregation over load-value, but the load-value type is keyword. I have two options:
1- changing the load-value type that causes a reindex
2- casting the load-value to double dynamically

I tried the second one in the ElasticSearch, but in Grafana I could not prepare the correct query.

I suggest to change the type into integer, then you will simple enough to aggregate the value.
If there using logstash as ingestion tools, just modify the filter using mutate copy_field, and convert from string to integer.
The other way around using reindex with pipeline to change the field type.

Thank you for your responses.

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.

The result is something like this: