# Parsing the Windows Message Field (Postprocessing after eventlog filter)

**URL:** <https://discuss.elastic.co/t/parsing-the-windows-message-field-postprocessing-after-eventlog-filter/29857>\
**Category:** Logstash\
**Created:** [September 23, 2015, 6:34pm UTC](https://discuss.elastic.co/t/parsing-the-windows-message-field-postprocessing-after-eventlog-filter/29857 "2015-09-23T18:34:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![h2k](https://avatars.discourse-cdn.com/v4/letter/h/e5b9ba/32.png) [@h2k](https://discuss.elastic.co/u/h2k)\
**Post date:** [September 23, 2015, 6:34pm UTC](https://discuss.elastic.co/t/parsing-the-windows-message-field-postprocessing-after-eventlog-filter/29857/1 "2015-09-23T18:34:06Z")

</div>

I have used the eventlog filter to pull down Windows Event Logs via Logstash. This has worked handsomely, except for the Message (not message) field, which looks like this:

Key file operation.

Subject:  
Security ID: S-1-5-18  
Account Name: WINTEST2$  
Account Domain: WORKGROUP  
Logon ID: 0x3E7

Cryptographic Parameters:  
Provider Name: Microsoft Software Key Storage Provider  
Algorithm Name: UNKNOWN  
Key Name: [redacted]  
Key Type: Machine key.

Key File Operation Information:  
File Path:   
C:\ProgramData[redacted]

```
Operation:	Read persisted key from file.
Return Code:	0x0

```

We need this data for analysis. The raw data for that contains the same data, except with a morass of \r\n\t\r\n\t\r\n\t escape characters, which makes parsing kind of hard. I'm hacking something together to grok out individual fields as I come across them, but has anyone else come across this and come up with a more elegant solution?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 23, 2015, 6:59pm UTC](https://discuss.elastic.co/t/parsing-the-windows-message-field-postprocessing-after-eventlog-filter/29857/2 "2015-09-23T18:59:21Z")

</div>

Have you tried the [kv](https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html) filter? With `field_split` set to a newline character and `value_split` set to ": " it might work. Otherwise the [ruby filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-ruby.html) might be the easiest way out.

---

<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:** [July 6, 2017, 5:28am UTC](https://discuss.elastic.co/t/parsing-the-windows-message-field-postprocessing-after-eventlog-filter/29857/3 "2017-07-06T05:28:13Z")

</div>


