# Parsing syslog RFC 5424 format

**URL:** <https://discuss.elastic.co/t/parsing-syslog-rfc-5424-format/261021>\
**Category:** Logstash\
**Created:** [January 13, 2021, 4:20pm UTC](https://discuss.elastic.co/t/parsing-syslog-rfc-5424-format/261021 "2021-01-13T16:20:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![S3l3ct3d](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s3l3ct3d/32/77965_2.png) [@S3l3ct3d](https://discuss.elastic.co/u/S3l3ct3d)\
**Post date:** [January 13, 2021, 4:20pm UTC](https://discuss.elastic.co/t/parsing-syslog-rfc-5424-format/261021/1 "2021-01-13T16:20:04Z")

</div>

Good morning,

I have a log source that sends syslog messages in RFC 5424 format. I have searched everywhere to figure out how to parse these syslog messages. Since logstash's syslog input is for RFC 3164 format, nothing is working properly.

I have tried multiple grok patterns and nothing seems to work. Can anyone assist?

The raw log coming in looks like this:

```auto
{"@version":"1","message":"<40>2021-01-13T11:09:29Z <ipaddress> Agent Desc: Retina\tAgent ID: retina\tAgent Ver: 6.7.6.3716\tCategory: OSDETECT\\CpeString\tSource Host: <hostname>\tEvent Desc: cpe:/o:microsoft:windows_10::v1809:x64\tEvent Name: CPE Name\tOS: \tEvent Severity: 0\tSource IP: <ipaddress>\tEvent Subject: <ipaddress5>\tEvent Type: 0\tUser: <hostname>$\tWorkgroup Desc: BeyondTrust\tWorkgroup ID: BeyondTrust Workgroup\tWorkgroup Location: Default Location\r\n","@timestamp":"2021-01-13T16:09:29.932Z","host":"<ipaddress>"}

```

Thank you

---

<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:** [January 13, 2021, 8:53pm UTC](https://discuss.elastic.co/t/parsing-syslog-rfc-5424-format/261021/2 "2021-01-13T20:53:21Z")

</div>

I suggest you use a dissect filter to take off the `<40>2021-01-13T11:09:29Z <ipaddress> ` and then a kv filter to parse the rest.

---

<div class="post-metadata">

**Author:** ![S3l3ct3d](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s3l3ct3d/32/77965_2.png) [@S3l3ct3d](https://discuss.elastic.co/u/S3l3ct3d)\
**Post date:** [January 13, 2021, 9:07pm UTC](https://discuss.elastic.co/t/parsing-syslog-rfc-5424-format/261021/3 "2021-01-13T21:07:56Z")

</div>

Thanks Badger

---

<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:** [February 10, 2021, 9:07pm UTC](https://discuss.elastic.co/t/parsing-syslog-rfc-5424-format/261021/4 "2021-02-10T21:07:57Z")

</div>

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