# Parsing EventData field correctly from json input

**URL:** <https://discuss.elastic.co/t/parsing-eventdata-field-correctly-from-json-input/214891>\
**Category:** Logstash\
**Created:** [January 13, 2020, 6:50pm UTC](https://discuss.elastic.co/t/parsing-eventdata-field-correctly-from-json-input/214891 "2020-01-13T18:50:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bensonmp](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@bensonmp](https://discuss.elastic.co/u/bensonmp)\
**Post date:** [January 13, 2020, 6:50pm UTC](https://discuss.elastic.co/t/parsing-eventdata-field-correctly-from-json-input/214891/1 "2020-01-13T18:50:38Z")

</div>

Hi,

I'm new to using ELK. I'm looking for some help to properly parse the **EventData** field from my windows logs. Here's an example event:

\<Event xmlns="[http://schemas.microsoft.com/win/2004/08/events/event](http://schemas.microsoft.com/win/2004/08/events/event)"\>  
\<System\>  
\<Provider Name="XXXXXX" /\>  
\<EventID Qualifiers="0"\>20\</EventID\>  
\<Level\>4\</Level\>  
\<Task\>0\</Task\>  
\<Keywords\>0x80000000000000\</Keywords\>  
\<TimeCreated SystemTime="2020-01-09T16:31:32.928992200Z" /\>  
\<EventRecordID\>36567\</EventRecordID\>  
\<Channel\>XXX-Log\</Channel\>  
\<Computer\>XXX-XXX-XXX\</Computer\>  
\<Security /\>  
\</System\>  
\<EventData\>  
**\<Data\>\<SUI\> \<OU\>XXX\</OU\> \<UID\>XXXXX\</UID\> \<COMP\>XXX-XXX-XXX\</COMP\> \</SUI\> \<PDMessage\> \<Message\>Some message\</Message\> \<DateTime\>00:00:05.5298444\</DateTime\> \</PDMessage\>\</Data\>**  
\</EventData\>  
\</Event\>

I'm using nxlog to ship the events from my system to Logstash. The nxlog conf is set to convert the event logs to json format and ship it out.

Is there a way on Logstash to properly extract the fields within EventData? EventData values differ for different events - it may have more/fewer tags within it.

Here's the Logstash config I'm using:  
**[https://github.com/Security-Onion-Solutions/securityonion-elastic/blob/master/configfiles/6300\_windows.conf](https://github.com/Security-Onion-Solutions/securityonion-elastic/blob/master/configfiles/6300_windows.conf)**

I'd really appreciate some help with this. Thanks!

---

<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, 2020, 7:29pm UTC](https://discuss.elastic.co/t/parsing-eventdata-field-correctly-from-json-input/214891/2 "2020-01-13T19:29:47Z")

</div>

> [@bensonmp](#):
>
> Is there a way on Logstash to properly extract the fields within EventData? EventData values differ for different events - it may have more/fewer tags within it.

Use an [xml](https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html) filter.

---

<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, 2020, 7:29pm UTC](https://discuss.elastic.co/t/parsing-eventdata-field-correctly-from-json-input/214891/3 "2020-02-10T19:29:50Z")

</div>

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