Access specific field (elasticsearch as datasource)

Hello,

I have set Elasticsearch as datasource which works correctly. I would like to filter for specific documents and see the value of this specific field which is called “count” in the filtered document.

The Lucene query works correctly and looks like that:

tags:db AND tags:hourly AND tags:NEG AND env.keyword:“env1”

Query filters for documents which are sent every hour and as you can see in the screen below works correctly.

Every document of theese has a field named “count” and a value.
Instead of viewing on the chart the count of documents I would like to view the value of “count” field in the given document. How to do this? Is it possible?

When i switch the “Query type” from “Metrics” to “Logs” i get following error:

[sse.readDataError] [A] got error: input data must be a wide series but got type long (input refid)

Does anybody have an idea if this is possible?

what does your es document look like please post sample

I would like to inspect this document but when I choose ‘Query type’ Logs instead of metrics i get:

[sse.readDataError] [A] got error: input data must be a wide series but got type long (input refid)

The same happens if I choose ‘Raw Data’

any ideas?

Hi, I guess your Elasticsearch query looks like this
image

You can actually change the Count metric type to some other types by clicking on the Count. You can change it (for example) to Sum, like here:
image

I’m not sure if you can present all the values from the documents but maybe sum or some other aggregation will suffice (I guess Grafana wouldn’t know how to visualize each value since it’s a variative count of points).

Does it work for you? If not, you can try to play around with “Logs” in Table visualization and apply some transformations.