Query between a range H

Hello all :slight_smile:

I'm blocked on one of my queries. I would like to receive the data everyday between
00H00 to 06H00
06H00 to 12H00
12H00 to 18H00
18H00 to 24H00

But I can't use now-12H or now-6H because I can't to be precise with that.
MAybe use the time epoch?

Do you have any idea?

Thank you in advance.

Do you have an epoch field in your documents? Or just the time of days? Seeing an example of what a document looks like would help.

I would like to receive the data everyday between

There are probably a few ways to do it, but the most straightforward that I think you'd have luck with would be to use a Date Histogram aggregation. Given a set of documents with an absolute date (year, month, day, time of day), Elasticsearch can break down stats on a basis of 6-hour periods. You will need to have a field mapped as date in the data, which requires some setup.

Kibana has visualization tools to help you create your own charts and tables of your date using Elasticsearch's Date histogram aggregation. You'll need your data to be set up per the documentation I linked to.

Hello :slight_smile:

I had only the time stamp so I had work with the time epoch and it works correctly now :slight_smile:
So I suggest to use the time epoch for your query :wink:

Best regards

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.