# Syslog Input - Grok Error

**URL:** <https://discuss.elastic.co/t/syslog-input-grok-error/206752>\
**Category:** Logstash\
**Created:** [November 6, 2019, 8:54am UTC](https://discuss.elastic.co/t/syslog-input-grok-error/206752 "2019-11-06T08:54:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerard.ramos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gerard.ramos/32/46958_2.png) [@gerard.ramos](https://discuss.elastic.co/u/gerard.ramos)\
**Post date:** [November 6, 2019, 8:54am UTC](https://discuss.elastic.co/t/syslog-input-grok-error/206752/1 "2019-11-06T08:54:07Z")

</div>

Hello!

I have this input:

> \<189\>date=2019-11-06 time=09:18:24 devname="FW" devid="FG200D4Q645" logid="0000000011" type="traffic" subtype="forward" level="notice" vd="josep" eventtime=1573045874 srcip=192.168.1.1 srcport=22222 srcintf="vlan11" srcintfrole="undefined" dstip=4.221.55.87 dstport=443 dstintf="vlan55" dstintfrole="undefined" poluuid="8az53d526-5480-5je6-d2f3-1c0d252b8ccde" sessionid=1457621354 proto=2 action="accept" policyid=11 policytype="policy" service="HTTPS" dstcountry="Country" srccountry="Reserved" trandisp="snat" transip=155.84.27.111 transport=22222 appid=41245 app="HTTPS.BROWSER" appcat="Web.Client" apprisk="medium" applist="AppControl\_General" appact="detected" duration=1120 sentbyte=4449 rcvdbyte=12391 sentpkt=223 rcvdpkt=222 sentdelta=222 rcvddelta=222

I set the following input:

> syslog {  
> port =\> 5444  
> type =\> 'firewall'  
> }

The data is coming to logstash but does not recognize the fields. I understand that if it is an input syslog would I have to do the automatic grok? Also I have a tag that says this:

> tags: \_grokparsefailure\_sysloginput

Any idea what can happen? Thanks for your time!

---

<div class="post-metadata">

**Author:** ![krokodil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krokodil/32/45616_2.png) [@krokodil](https://discuss.elastic.co/u/krokodil)\
**Post date:** [November 7, 2019, 5:54am UTC](https://discuss.elastic.co/t/syslog-input-grok-error/206752/2 "2019-11-07T05:54:53Z")

</div>

Your syslog might be UDP or TCP - tcpdump to confirm and change the input.

Also use kvdata instead since your message is already in a key value pair format.

[https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html)

Basic example:

```auto
input { 
  udp {
    port => 5444
  }
}

filter {
  kv {
      source => "message"
  }
}

output {
  stdout {
    codec => "rubydebug"
  }
}

```

Test that and see if it works. It's a very basic example just to put you on the right path.

---

<div class="post-metadata">

**Author:** ![gerard.ramos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gerard.ramos/32/46958_2.png) [@gerard.ramos](https://discuss.elastic.co/u/gerard.ramos)\
**Post date:** [November 7, 2019, 4:28pm UTC](https://discuss.elastic.co/t/syslog-input-grok-error/206752/3 "2019-11-07T16:28:09Z")

</div>

Thanks for your answer, I finaly have:

```
input {
  udp {
    port => 5444
	type => "firewall"
  }
}

filter {
  if [type] == "firewall" {
    kv {
      source => "message"
    }
  }
}

output {
    elasticsearch { 
      hosts => ["localhost:9200"]
      index => "firewall-%{+yyyy.ww}"
    }
}
```

---

<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:** [December 5, 2019, 4:28pm UTC](https://discuss.elastic.co/t/syslog-input-grok-error/206752/4 "2019-12-05T16:28:37Z")

</div>

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