# How can i read seperated logs only when there is error occured current logs in Logstash?

**URL:** <https://discuss.elastic.co/t/how-can-i-read-seperated-logs-only-when-there-is-error-occured-current-logs-in-logstash/28580>\
**Category:** Logstash\
**Created:** [September 3, 2015, 6:10am UTC](https://discuss.elastic.co/t/how-can-i-read-seperated-logs-only-when-there-is-error-occured-current-logs-in-logstash/28580 "2015-09-03T06:10:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RohanKumbhar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohankumbhar/32/23649_2.png) [@RohanKumbhar](https://discuss.elastic.co/u/RohanKumbhar)\
**Post date:** [September 3, 2015, 6:10am UTC](https://discuss.elastic.co/t/how-can-i-read-seperated-logs-only-when-there-is-error-occured-current-logs-in-logstash/28580/1 "2015-09-03T06:10:21Z")

</div>

Hi Team,

I have one use case , where there two log files available in log folder and when there is error occured in1st log file i want to read the 2nd log file and then co-relate the information from the both file and push to ES?

Can i use read file option in filter segment?

need your help here

Thanks,  
Rohan

---

<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:** [September 3, 2015, 6:16am UTC](https://discuss.elastic.co/t/how-can-i-read-seperated-logs-only-when-there-is-error-occured-current-logs-in-logstash/28580/2 "2015-09-03T06:16:12Z")

</div>

I don't think you can do it this way, I'm struggling to think of any other option though.  
Maybe someone else like Magnus can help though!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 3, 2015, 8:38am UTC](https://discuss.elastic.co/t/how-can-i-read-seperated-logs-only-when-there-is-error-occured-current-logs-in-logstash/28580/3 "2015-09-03T08:38:52Z")

</div>

No, this isn't possible out of the box. You could still use Logstash but you'd have to build something outside of Logstash (or possibly a custom plugin) to do the rest.

---

<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:** [July 6, 2017, 5:30am UTC](https://discuss.elastic.co/t/how-can-i-read-seperated-logs-only-when-there-is-error-occured-current-logs-in-logstash/28580/4 "2017-07-06T05:30:16Z")

</div>

Closed on July 6, 2017, 5:30am UTC


