Wrong Elasticsearch query

Hi all. I just started using Grafana but I am experiencing some difficulties with setting Elasticsearch query in Grafana.

The goal is to create the chart that will display server memory usage per different processes. I defined the following fields:
Query: beat.name:beatServerName
Metric: Average of system.process.memory.rss.bytes
Group by: system.process.name
Then by: @timestamp

But for some reason there is no any data displayed on chart, though the same chart shows data in Kibana.
Could anybody explain what is the issue?

Did you investigate the query sent by grafana and the elasticsearch response? (open chrome dev tools network tab)

Hi Torkel,

This is how request looks:


This is response:


No hits, make sure the lucene filter is correct, are you using correct case (maybe some char needs to be upper case)

In Elasticsearch data source settings I changed Index name to [metricbeat-]YYYY.MM.DD

The query is:



And now I am getting the error:

No field name specified to use for x-axis, check your axes settings

And these are Axes settings:

By the way, this is the request for the same chart in Kibana:


X axis mode should be time series

That helped, thanks a lot. I faced another issue: When I select data range Last 6 hours, there is chart displayed with data, but when I select date range Last 1 hour - there is no any data on chart:

I’ve experienced something similar when my server timestamp didn’t match the expected range.
You might check that the epoch dates being sent are not “in the future” according to the elastic server.

Also check the FAQ section on the community, there is an topic there for that scenario (zoom in and no data)

Data is written to ES every 10s. I set Group by time interval as >20s but I can see chart with data for the period not later then Last 1 hour. Though in Kibana period Last 20s works good and shows the data.
Is it expected result?

Maybe there is a time difference between your ES server or collector and your browser time?

That’s true, browser time is few hours less then ES and Grafana server time. But in this case I should see the data for period Last 15 min. Because the data for Last 15 min period already exists in ES.

You could compare the ES query that Kibana is using to the query that Grafana is producing.
Maybe something else will be revealed.

you can investigate the query & the response, here is a guide: