Maintaining Order of logs with elastic-search search API


(shaheryar) #1

How can i retrieve logs from elastic search in the order they were generated?


(Christian Dahlqvist) #2

If you are gathering logs using Filebeat, this will record a timestamp as well as the filename and the offset of the log entry within this file. When you search you should be able to get the correct order by sorting based on timestamp and offset.


(shaheryar) #3

I have time stamp but not the offset. I am gathering logs from a tcp (input plugin) connection to logstash and forwarding it to elastic search.


(Christian Dahlqvist) #4

Then you will only be able to order them by timestamp. If multiple documents have the same timestamp I do not you can establish the order between these.


(shaheryar) #5

ok. thanks for quick response.


(system) #6

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