# Send all Syslog messages that don't match output to another index?

**URL:** <https://discuss.elastic.co/t/send-all-syslog-messages-that-dont-match-output-to-another-index/272418>\
**Category:** Logstash\
**Created:** [May 7, 2021, 12:34pm UTC](https://discuss.elastic.co/t/send-all-syslog-messages-that-dont-match-output-to-another-index/272418 "2021-05-07T12:34:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeromeat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeromeat/32/87195_2.png) [@jeromeat](https://discuss.elastic.co/u/jeromeat)\
**Post date:** [May 7, 2021, 12:34pm UTC](https://discuss.elastic.co/t/send-all-syslog-messages-that-dont-match-output-to-another-index/272418/1 "2021-05-07T12:34:05Z")

</div>

Noob here, so don't judge too hard. 😉

However, I am wanting to find out if it's possible to have an output as such that's looking for specific tags and sending those messages to the windows\* index but if they don't match they go to a pipeline\* index. Is that possible???

```auto
       }
    output {
            if "NxLog","Windows Event" in [tags] {
                elasticsearch {
                hosts => "${ELASTICSEARCH_HOST_AND_PORT:elasticsearch.:9200}"
                index => "windowsevent-%{+YYYY.MM.dd}"
                }}
            else {
                elasticsearch {
                hosts => "${ELASTICSEARCH_HOST_AND_PORT:elasticsearch.:9200}"
                index => "pipeline-%{+YYYY.MM.dd}"
            }
    }

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 7, 2021, 5:00pm UTC](https://discuss.elastic.co/t/send-all-syslog-messages-that-dont-match-output-to-another-index/272418/2 "2021-05-07T17:00:16Z")

</div>

> [@jeromeat](#):
>
> `if "NxLog","Windows Event" in [tags] {`

This can be done using a conditional in the output section, but I think it would need to be

```
if "NxLog" in [tags] or "Windows Event" in [tags] { ...

```

---

<div class="post-metadata">

**Author:** ![jeromeat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeromeat/32/87195_2.png) [@jeromeat](https://discuss.elastic.co/u/jeromeat)\
**Post date:** [May 9, 2021, 9:22pm UTC](https://discuss.elastic.co/t/send-all-syslog-messages-that-dont-match-output-to-another-index/272418/3 "2021-05-09T21:22:02Z")

</div>

Great..thanks for confirming.

---

<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 6, 2021, 9:22pm UTC](https://discuss.elastic.co/t/send-all-syslog-messages-that-dont-match-output-to-another-index/272418/4 "2021-06-06T21:22:58Z")

</div>

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