# Trace logs in ES

**URL:** <https://discuss.elastic.co/t/trace-logs-in-es/70620>\
**Category:** Elasticsearch\
**Created:** [January 4, 2017, 11:32pm UTC](https://discuss.elastic.co/t/trace-logs-in-es/70620 "2017-01-04T23:32:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chunji08](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@chunji08](https://discuss.elastic.co/u/chunji08)\
**Post date:** [January 4, 2017, 11:32pm UTC](https://discuss.elastic.co/t/trace-logs-in-es/70620/1 "2017-01-04T23:32:53Z")

</div>

Hi there,  
My current LogStash project is trying to have all the submitted jobs indexed in ES, and if there was a job with some failure, we should return back the immediate cause of the failure. At this moment, I have these 2 questions now if someone can help.

1. Given a log file, if we know the key message in a log file, sometimes, I may also need to get the before/after lines of that key part. Something as if I was running this unix command "grep -B5 -A5 server.log". So Is there a way we could have the similar mechanism in ES ?

2. Some of our log file does not give the root cause of failure, but contains the message as " check further details in a different log file ... ". For something like this, what would be the better way to trace the root cause ?

Thanks,  
Chun

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 5, 2017, 12:11am UTC](https://discuss.elastic.co/t/trace-logs-in-es/70620/2 "2017-01-05T00:11:08Z")

</div>

1. Nope.
2. That's more a user oriented problem.

---

<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:** [February 2, 2017, 12:11am UTC](https://discuss.elastic.co/t/trace-logs-in-es/70620/3 "2017-02-02T00:11:12Z")

</div>

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