# Cisco Meraki Syslog - Using Two Grok Patterns in the same filter

**URL:** <https://discuss.elastic.co/t/cisco-meraki-syslog-using-two-grok-patterns-in-the-same-filter/152105>\
**Category:** Logstash\
**Created:** [October 11, 2018, 5:59pm UTC](https://discuss.elastic.co/t/cisco-meraki-syslog-using-two-grok-patterns-in-the-same-filter/152105 "2018-10-11T17:59:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dts](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dts](https://discuss.elastic.co/u/dts)\
**Post date:** [October 11, 2018, 5:59pm UTC](https://discuss.elastic.co/t/cisco-meraki-syslog-using-two-grok-patterns-in-the-same-filter/152105/1 "2018-10-11T17:59:32Z")

</div>

Hello,

I have created a conf with two grok patterns. When I run the conf it seems to only process the first pattern and not the second one. I have tested both pattens in a couple of online Grok sites and they both work. What am I missing to get both to work?

```
    filter {
           grok {

   match => ["message", "%{CISCOTIMESTAMP:timestamp} %{SYSLOGHOST:host.id} %{NUMBER:version} %{BASE10NUM:epoch_time} %{WORD:host.name} (?<log_type>[a-zA-Z0-9\-]+)([])? (src=)%{IP:source.ip} (dst=)%{IP:destination.ip} (mac=%{MAC:source_mac})?([])?(protocol=)%{WORD:network.protocol} (sport=)%{POSINT:source.port} (dport=)%{POSINT:destination.port} (pattern: )%{WORD:allowed} %{WORD:event.action}"]

   match => ["message", "%{CISCOTIMESTAMP:timestamp} %{SYSLOGHOST:host.id} %{NUMBER:version} %{BASE10NUM:epoch_time} %{WORD:host.name} (?<log_type>[a-zA-Z0-9\-]+)([])? %{WORD:event.action} (src=)%{IP:source.ip} (dst=)%{IP:destination.ip} (mac=%{MAC:source_mac})?([])?(protocol=)%{WORD:network.protocol} (sport=)%{POSINT:source.port} (dport=)%{POSINT:destination.port"]

        }

mutate {
            remove_field => ["host"]

            # for inbound flows, sometimes 0 and 1 are used for "allowed".
            #this statement will replace them
            gsub => [
                "allowed", "1", "denied",
                "allowed", "0", "allowed"
            ]
            # severity informational
            add_field => {"syslog_pri" => "6"}
        }

}
```

---

<div class="post-metadata">

**Author:** ![Makra](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Makra](https://discuss.elastic.co/u/Makra)\
**Post date:** [October 12, 2018, 4:05am UTC](https://discuss.elastic.co/t/cisco-meraki-syslog-using-two-grok-patterns-in-the-same-filter/152105/2 "2018-10-12T04:05:38Z")

</div>

Try with the following single match block:

```
grok {
                match => [ 
                            "message", "YOUR_PATTERN1" ,
                            "message", "YOUR_PATTERN2" 
                 
                         ]
}
```

---

<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:** [November 9, 2018, 4:05am UTC](https://discuss.elastic.co/t/cisco-meraki-syslog-using-two-grok-patterns-in-the-same-filter/152105/3 "2018-11-09T04:05:41Z")

</div>

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