<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to extract field from Windows event log in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430958#M123195</link>
    <description>&lt;P&gt;Try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="LogName=Microsoft-Windows-AppLocker/EXE and DLL
SourceName=Microsoft-Windows-AppLocker
EventCode=8002
EventType=4
Type=Information
SidType=1
TaskCategory=None
OpCode=Info
RecordNumber=24254
Keywords=None
Message=%SYSTEM32%\TASKHOSTW.EXE was allowed to run." 
| rex field=data "Message=.*\\\(?&amp;lt;Application&amp;gt;[^\s]+)\s\w+"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On your prod data the code would be &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "Message=.*\\\(?&amp;lt;Application&amp;gt;[^\s]+)\s\w+"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 07 Aug 2019 17:04:09 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2019-08-07T17:04:09Z</dc:date>
    <item>
      <title>How to extract field from Windows event log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430957#M123194</link>
      <description>&lt;P&gt;The event I have is from a windows event log and AppLocker&lt;/P&gt;

&lt;P&gt;See below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LogName=Microsoft-Windows-AppLocker/EXE and DLL
SourceName=Microsoft-Windows-AppLocker
EventCode=8002
EventType=4
Type=Information
SidType=1
TaskCategory=None
OpCode=Info
RecordNumber=24254
Keywords=None
Message=%SYSTEM32%\TASKHOSTW.EXE was allowed to run.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to extract the new field labeled "Application" and have the search return the &lt;EM&gt;TASKHOSTW.EXE&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;How can I do this? (Regex is not my strong suit)&lt;/P&gt;

&lt;P&gt;p.s. Happy to do the extraction at the time of the search.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 16:03:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430957#M123194</guid>
      <dc:creator>davidjohnbecket</dc:creator>
      <dc:date>2019-08-07T16:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field from Windows event log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430958#M123195</link>
      <description>&lt;P&gt;Try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="LogName=Microsoft-Windows-AppLocker/EXE and DLL
SourceName=Microsoft-Windows-AppLocker
EventCode=8002
EventType=4
Type=Information
SidType=1
TaskCategory=None
OpCode=Info
RecordNumber=24254
Keywords=None
Message=%SYSTEM32%\TASKHOSTW.EXE was allowed to run." 
| rex field=data "Message=.*\\\(?&amp;lt;Application&amp;gt;[^\s]+)\s\w+"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On your prod data the code would be &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "Message=.*\\\(?&amp;lt;Application&amp;gt;[^\s]+)\s\w+"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Aug 2019 17:04:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430958#M123195</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-08-07T17:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field from Windows event log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430959#M123196</link>
      <description>&lt;P&gt;Hi @davidjohnbeckettorb &lt;/P&gt;

&lt;P&gt;If it's a regex you would like to use, below should work for you.&lt;/P&gt;

&lt;P&gt;|rex field=Message "(?i)^.+\\(?P&amp;lt;'Application'&amp;gt;[^\s]+)" &lt;/P&gt;

&lt;P&gt;provided you are trying to capture the value between the first This--&amp;gt;\ and the next space that appears.&lt;/P&gt;

&lt;P&gt;Please remove the '' in Application while attempting it. Not sure how I include text in angular&lt;/P&gt;

&lt;P&gt;There are other ways to achieve this using an eval and it can be explored if you need to.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 17:10:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430959#M123196</guid>
      <dc:creator>vik_splunk</dc:creator>
      <dc:date>2019-08-07T17:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field from Windows event log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430960#M123197</link>
      <description>&lt;P&gt;Thank you @vik_splunk - worked a treat!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 11:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430960#M123197</guid>
      <dc:creator>davidjohnbecket</dc:creator>
      <dc:date>2019-08-08T11:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field from Windows event log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430961#M123198</link>
      <description>&lt;P&gt;Thank you @ mayurr98. Add this to my search and pulled out the application nicely. Much appreciated &lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 12:00:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-from-Windows-event-log/m-p/430961#M123198</guid>
      <dc:creator>davidjohnbecket</dc:creator>
      <dc:date>2019-08-08T12:00:30Z</dc:date>
    </item>
  </channel>
</rss>

