# Searching like using grep -A5

**URL:** <https://discuss.elastic.co/t/searching-like-using-grep-a5/200698>\
**Category:** Elasticsearch\
**Created:** [September 23, 2019, 1:27pm UTC](https://discuss.elastic.co/t/searching-like-using-grep-a5/200698 "2019-09-23T13:27:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vasek/32/136636_2.png) [@vasek](https://discuss.elastic.co/u/vasek)\
**Post date:** [September 23, 2019, 1:27pm UTC](https://discuss.elastic.co/t/searching-like-using-grep-a5/200698/1 "2019-09-23T13:27:24Z")

</div>

Hi Elasticians,  
a developer looking for feature like this:

`grep -A5 "ERROR" /var/log/error.log`

Developer can find necessary error lines from some log and after that he need to find logs which was generated before these error logs.

Does Elasticsearch/Kibana provide some feature like: give me result based on Lucene/KQL a furthermore give me e.g. 5 events generated before that events.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 21, 2019, 1:27pm UTC](https://discuss.elastic.co/t/searching-like-using-grep-a5/200698/2 "2019-10-21T13:27:24Z")

</div>

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