# Exclude a sequence of logs

**URL:** <https://discuss.elastic.co/t/exclude-a-sequence-of-logs/97354>\
**Category:** Logstash\
**Created:** [August 17, 2017, 7:27am UTC](https://discuss.elastic.co/t/exclude-a-sequence-of-logs/97354 "2017-08-17T07:27:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hisushi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hisushi/32/20551_2.png) [@Hisushi](https://discuss.elastic.co/u/Hisushi)\
**Post date:** [August 17, 2017, 7:27am UTC](https://discuss.elastic.co/t/exclude-a-sequence-of-logs/97354/1 "2017-08-17T07:27:23Z")

</div>

Hi everybody,

I'd like to exclude a given sequence of logs in Logstash or pass them to a separate index as they are created when the logfile itself is generated by a predefined procedure. Is this even possible? My approach is to process them using, e.g., the `grok` filter and do some `if then else` expression but I've got no idea how to establish a relation between, let's say, 5 successive lines.

Best regards and thanks in advance,

Hisushi

---

<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:** [September 14, 2017, 7:27am UTC](https://discuss.elastic.co/t/exclude-a-sequence-of-logs/97354/2 "2017-09-14T07:27:28Z")

</div>

Closed on September 14, 2017, 7:27am UTC

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