I have a requirement in elastic search to display n lines after the search result. So I will search with an expression and when I select the search result, it should display n lines after that. Is there a way to retrieve the continuous lines after search result?
What do you mean by lines?
For example if I have a log.file with lines
"Sample logs line1...
Sample log line2.....
Sample log line3..." and if I search for line1, I will get "Sample logs line1",
After that I need to extract the other lines below it...
"Sample log line2.....
Sample log line3..."
Can I use any features of ES here?
I am using logstash to index the logs and need to extract the snippet after searching a string.
You could use scan/scroll, but you would then have to figure out where your line is.
Could you please give some details?
"but you would then have to figure out where your line is.", do you mean document position?
I can get the document with that particular line...