I have to query Elastic search to return time ranges
My data is
{"run-id": "xxx", "name": "unknown", "event" : [{"value": "event name1"}], "epoch" : 1576530536}
{"run-id": "xxx", "name": "unknown", "event" : [{"value": "event name1"}], "epoch" : 1576530537}
{"run-id": "xxx", "name": "unknown", "event" : [{"value": "event name1"}], "epoch" : 1576530540}
{"run-id": "xxx", "name": "unknown", "event" : [{"value": "event name1"}], "epoch" : 1576530541}
{"run-id": "xxx", "name": "unknown", "event" : [{"value": "event name1"}], "epoch" : 1576530542}
I need output as 1576530536-1576530537 and 1576530540-1576530542 when searched for event=event name1. Is there a way to return values as range with start and end epoch
hm, I am still not sure about the requirement to be honest. If you want to group things together, maybe a histogram aggregation could help you in order to group data together.
maybe you can explain in more detail what your grouping criteria is. A distance greater than one?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.