# Extract Field from Windows EventLog using Logstash

**URL:** <https://discuss.elastic.co/t/extract-field-from-windows-eventlog-using-logstash/210803>\
**Category:** Logstash\
**Tags:** windows\
**Created:** [December 6, 2019, 2:21am UTC](https://discuss.elastic.co/t/extract-field-from-windows-eventlog-using-logstash/210803 "2019-12-06T02:21:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmoham](https://avatars.discourse-cdn.com/v4/letter/n/77aa72/32.png) [@nmoham](https://discuss.elastic.co/u/nmoham)\
**Post date:** [December 6, 2019, 2:21am UTC](https://discuss.elastic.co/t/extract-field-from-windows-eventlog-using-logstash/210803/1 "2019-12-06T02:21:26Z")

</div>

Hi,

I'm new to using Logstash for parsing data. We've windows Event Logs coming though Winbeats to Logstash and then sent to Elastic Search . I am trying to extract different fields using Logstash, but it doesn't work.,

I have created a file winevents.conf under the pipeline folder (/usr/share/logstash/pipeline) and here are the contents config file -

input {  
beats {  
port =\> 1514  
ssl =\> true  
client\_inactivity\_timeout =\> 7200  
ssl\_verify\_mode =\> "none"  
#ssl\_certificate\_authorities =\> ["/usr/share/logstash/config/ca.cer"]  
ssl\_certificate =\> "/usr/share/logstash/config/lumberjack\_cert.crt"  
ssl\_key =\> "/usr/share/logstash/config/lumberjack\_cert.key"  
}  
}

filter {  
grok {  
#patterns\_dir =\> "/etc/logstash/patterns"  
match =\> { "message" =\> { message =\> "CLSID: '(?\<appd\_id\>[^']+)" } }

```
     }
}

output {
  stdout { 
	codec => rubydebug
    }

```

elasticsearch {  
hosts =\> "[https://elks2.nam.io:443](https://elks2.nam.io:443)"  
user =\> "something"  
password =\> "something"  
keystore =\> "/usr/share/logstash/config/cacerts"  
keystore\_password =\> "something"  
manage\_template =\> false  
index =\> "%{[@metadata][beat]}-%{+YYYY.MM.dd}"  
}  
}

example Event in the message field -

.NET Runtime version 4.0.30319.36575 - The profiler has requested that the CLR instance not load the profiler into this process. Profiler CLSID: 'AppDynamics.AgentProfiler'. Process ID (decimal): 83484. Message ID: [0x2516]

I want to extract "AppDynamics.AgentProfiler" into a separate field appd\_id .

This is my first step towards using Logstash for extractions and have more to do ; appreciate your guidance and help.

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:** [December 6, 2019, 1:18pm UTC](https://discuss.elastic.co/t/extract-field-from-windows-eventlog-using-logstash/210803/2 "2019-12-06T13:18:38Z")

</div>

> [@nmoham](#):
>
> match =\> { "message" =\> { message =\> "CLSID: '(?\<appd\_id\>[^']+)" } }

That should be

```
match => { message => "CLSID: '(?<appd_id>[^']+)" }

```

---

<div class="post-metadata">

**Author:** ![nmoham](https://avatars.discourse-cdn.com/v4/letter/n/77aa72/32.png) [@nmoham](https://discuss.elastic.co/u/nmoham)\
**Post date:** [December 6, 2019, 6:41pm UTC](https://discuss.elastic.co/t/extract-field-from-windows-eventlog-using-logstash/210803/3 "2019-12-06T18:41:09Z")

</div>

hi @Badger

made the correction, but still doesn't work. 😔

---

<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:** [December 6, 2019, 8:00pm UTC](https://discuss.elastic.co/t/extract-field-from-windows-eventlog-using-logstash/210803/4 "2019-12-06T20:00:20Z")

</div>

Are you sure it is the message field you should be matching against?

---

<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:** [January 3, 2020, 8:00pm UTC](https://discuss.elastic.co/t/extract-field-from-windows-eventlog-using-logstash/210803/5 "2020-01-03T20:00:36Z")

</div>

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