sivasamyk / logtrail

Kibana plugin to view, search & live tail log events
MIT License
1.4k stars 185 forks source link

See context around search #206

Open Globegitter opened 7 years ago

Globegitter commented 7 years ago

Often when I do a search, e.g. I search for a specific request, I want to be able to see context around that search, e.g. the request that happened before or after - Would it be possible to somehow add the possibility to show x lines before / after each search result? Not sure what the best approach here would be, I could either imagine "dynamically", so that each search result has a link/button to shore more context arond it, or simply a static config "show x lines before/after each serach result.

What do you think?

sivasamyk commented 7 years ago

@Globegitter Thanks for the suggestion. Need to check if this facility is available in elasticsearch query.

Globegitter commented 6 years ago

That is a good point @sivasamyk - I had a quick look into it and could find these things: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html, https://discuss.elastic.co/t/get-previous-and-next-document-ids-with-a-filtered-query/31877, https://stackoverflow.com/questions/30487320/get-previous-and-next-document-by-date-in-elasticsearch

The last two links are a bit older now, but there mugger not be a really elegant solution.

lpic10 commented 6 years ago

Kibana uses this when clicking to see surrounding documents: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-after.html

It makes same query twice using order asc and desc to get the documents before and after.

mariusheil commented 5 years ago

Any progress on this? Would be a very helpful addition

bradvido commented 5 years ago

context would be great!