# Jump out of filter to output

**URL:** <https://discuss.elastic.co/t/jump-out-of-filter-to-output/86490>\
**Category:** Logstash\
**Created:** [May 19, 2017, 9:19pm UTC](https://discuss.elastic.co/t/jump-out-of-filter-to-output/86490 "2017-05-19T21:19:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaxon\_Kochel](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Jaxon\_Kochel](https://discuss.elastic.co/u/Jaxon_Kochel)\
**Post date:** [May 19, 2017, 9:19pm UTC](https://discuss.elastic.co/t/jump-out-of-filter-to-output/86490/1 "2017-05-19T21:19:24Z")

</div>

Is there any way to jump out of the filter straight to output? I'm having an issue with log files with very similar names being picked up by multiple path =~, and its breaking my logging. is there anyway to jump out of the filter and go straight to the output.

i have a files that's called "ebi.server.error.(logsdate)" and some that are just "server.(logsdate)". An ebi.server.error log fits both path =~ "ebi.server.error" and then continues down the filter section and also hits path =~"server." is there anything i can add in the "ebi.server.error" section to jump out of the filter block and go straight to the output block?

Thank you soooo much in advance.

---

<div class="post-metadata">

**Author:** ![paz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paz/32/28003_2.png) [@paz](https://discuss.elastic.co/u/paz)\
**Post date:** [May 22, 2017, 12:16pm UTC](https://discuss.elastic.co/t/jump-out-of-filter-to-output/86490/2 "2017-05-22T12:16:36Z")

</div>

Don't know if I understood correctly, but you could use an if/else statement to do that (going from specific to generic).

E.g.

```auto
if [path] =~ "ebi.server.error" {
     ## do stuff
}
else if [path] =~ "server" {
     ## do stuff
}
```

Logs would go through the first matching statement and skip the rest.

---

<div class="post-metadata">

**Author:** ![Jaxon\_Kochel](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Jaxon\_Kochel](https://discuss.elastic.co/u/Jaxon_Kochel)\
**Post date:** [May 22, 2017, 1:11pm UTC](https://discuss.elastic.co/t/jump-out-of-filter-to-output/86490/3 "2017-05-22T13:11:56Z")

</div>

oh my gosh I feel so embarrassed, like duh. thank you!

---

<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:** [June 19, 2017, 1:12pm UTC](https://discuss.elastic.co/t/jump-out-of-filter-to-output/86490/4 "2017-06-19T13:12:04Z")

</div>

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