user1248042
user1248042

Reputation: 61

'Group by' in Kibana charts

I'm new to both Elasticsearch and Kibana, so this might be really simple so solve. I'm trying to summarize some data and display it in a simple Line Chart in Kibana, but having a hard time getting the result i want.

My data looks like this:

{"name": "Q1", "indexing_date": "2019-11-11T09:00:00", "items_in_queue": 2}
{"name": "Q2", "indexing_date": "2019-11-11T09:00:00", "items_in_queue": 3}
{"name": "Q1", "indexing_date": "2019-11-11T09:00:25", "items_in_queue": 2}
{"name": "Q2", "indexing_date": "2019-11-11T09:00:25", "items_in_queue": 4}
{"name": "Q3", "indexing_date": "2019-11-11T09:07:00", "items_in_queue": 1}
{"name": "Q2", "indexing_date": "2019-11-11T09:07:00", "items_in_queue": 3}

I want a Date Histogram (on "indexing_date") as the X-Axis, and a Sum (on "items_in_queue") on the Y-axis. With the example data above, the result would be 3 points with the sum 5, 6 and 4.

It works, but when I change the time period displayed in the chart, the first two points are merged together and displayed as one (with the value 5 + 6 = 11). Is it possible to force Kibana to "group by" a field ("indexing_date" in this case)? All documents included in each sum have the same "indexing_date".

If it makes it easier I have the possibility to change the layout of the documents.

Thanks in advance!

Upvotes: 2

Views: 3205

Answers (1)

Atul K.
Atul K.

Reputation: 372

While creating Date Histogram Aggregation, the interval is set to auto by default. You have to explicitly set the interval to Second. And you will have the visualization you want. Check out the screen below.

set the interval to Second

Upvotes: 2

Related Questions