# Multiple filters for syslog

**URL:** <https://discuss.elastic.co/t/multiple-filters-for-syslog/125407>\
**Category:** Logstash\
**Created:** [March 23, 2018, 7:28pm UTC](https://discuss.elastic.co/t/multiple-filters-for-syslog/125407 "2018-03-23T19:28:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![irb7501](https://avatars.discourse-cdn.com/v4/letter/i/d9b06d/32.png) [@irb7501](https://discuss.elastic.co/u/irb7501)\
**Post date:** [March 23, 2018, 7:28pm UTC](https://discuss.elastic.co/t/multiple-filters-for-syslog/125407/1 "2018-03-23T19:28:00Z")

</div>

Can anyone suggest how i might include another match for syslog in this beats.conf? I'm looking to collect some fortigate syslogs in addition to what we are collecting from other syslog sources.

input{  
beats{  
port =\> "5043"  
}  
}

filter {  
if [fields][logtype] == "syslog" {  
grok {  
match =\> { "message" =\> "%{SYSLOGTIMESTAMP:syslog\_timestamp} %{SYSLOGHOST:syslog\_hostname} %{DATA:syslog\_program}(?:[%{POSINT:syslog\_pid}])?: %{GREEDYDATA:syslog\_message}" }  
}  
date {  
match =\> ["syslog\_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss"]  
}  
}

```
if [fields][logtype] == "iis_log" {
    if [message] =~ "^#" {
        drop {}
    }

    grok {
        match => { "message" => ["%{TIMESTAMP_ISO8601:log_timestamp} %{WORD:iisSite} %{IPORHOST:site} %{WORD:method} %{URIPATH:page} %{NOTSPACE:querystring} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clienthost} %{NOTSPACE:useragent} %{NOTSPACE:referer}"] }
    }

}

```

}

output{  
elasticsearch {  
hosts =\> ["10.7.1.61:9200"]  
index =\> "%{[@metadata][beat]}-%{+YYYY.MM.dd}"  
document\_type =\> "%{[@metadata][type]}"  
}  
}

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [March 24, 2018, 8:30am UTC](https://discuss.elastic.co/t/multiple-filters-for-syslog/125407/2 "2018-03-24T08:30:35Z")

</div>

It's unclear from your post what you are attempting to do.

---

<div class="post-metadata">

**Author:** ![irb7501](https://avatars.discourse-cdn.com/v4/letter/i/d9b06d/32.png) [@irb7501](https://discuss.elastic.co/u/irb7501)\
**Post date:** [March 26, 2018, 5:39pm UTC](https://discuss.elastic.co/t/multiple-filters-for-syslog/125407/3 "2018-03-26T17:39:00Z")

</div>

I am wondering how an additional filter for syslog would look. This particular beats.conf has an existing filter for syslog on Linux - would I be able to add another for Fortigate syslog?

---

<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:** [April 23, 2018, 5:39pm UTC](https://discuss.elastic.co/t/multiple-filters-for-syslog/125407/4 "2018-04-23T17:39:24Z")

</div>

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