<?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 Windows fields at search time using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374414#M110056</link>
    <description>&lt;P&gt;I'm not sure if you can use them with the Splunk Add-On for Windows or not.&lt;/P&gt;

&lt;P&gt;If you really want to do the field extractions at index time (best practice is to do it at search time), then you could put something like this in your &lt;CODE&gt;transforms.conf&lt;/CODE&gt; file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_extraction]
REGEX = Security ID:\s+(?P&amp;lt;securityid&amp;gt;.*)[\s\S]+?Account Name:\s+(?P&amp;lt;accountname&amp;gt;.*)[\s\S]+?Account Domain:\s+(?P&amp;lt;accountdomain&amp;gt;.*)[\s\S]+?Login ID:\s+(?P&amp;lt;loginid&amp;gt;.*)[\s\S]+?Provider Name:\s+(?P&amp;lt;providername&amp;gt;.*)[\s\S]+?Algorithm Name:\s+(?P&amp;lt;algname&amp;gt;.*)[\s\S]+?Key Type:\s+(?P&amp;lt;keytype&amp;gt;.*)[\s\S]+?Operation:[\s\S]+?Operation:\s+(?P&amp;lt;operation&amp;gt;.*)[\s\S]+?Return Code:\s+(?P&amp;lt;returncode&amp;gt;.*)
FORMAT = securityid::"$1" accountname::"$2" accountdomain::"$3" loginid::"$4" providername::"$5" algname="$6" keytype="$7" operation::"$8" returncode::"$9"
WRITE_META = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and this in the &lt;CODE&gt;props.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_source_type]
TRANSFORM-extract-fields = my_extraction
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and this in fields.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[securityid]
INDEXED=true
[accountname]
INDEXED=true
[accountdomain]
INDEXED=true
[loginid]
INDEXED=true
[providername]
INDEXED=true
[algname]
INDEXED=true
[keytype]
INDEXED=true
[operation]
INDEXED=true
[returncode]
INDEXED=true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Oct 2017 16:57:46 GMT</pubDate>
    <dc:creator>cpetterborg</dc:creator>
    <dc:date>2017-10-06T16:57:46Z</dc:date>
    <item>
      <title>How to extract Windows fields at search time using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374408#M110050</link>
      <description>&lt;P&gt;How to extract the Account Name and other fields in the description field from the below windows event from azure? It has both JOSN and XMl data in JSON event. At&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3602i0907D00AB8154C5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;tahced are RAw event and JSON event. Please advise.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 17:25:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374408#M110050</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2017-10-04T17:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Windows fields at search time using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374409#M110051</link>
      <description>&lt;P&gt;Are you looking to do this at index time, or search time?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 17:51:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374409#M110051</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-10-04T17:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Windows fields at search time using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374410#M110052</link>
      <description>&lt;P&gt;If you are looking to do this at search time I suggest looking into the spath command. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath"&gt;Link to documentation here&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;If you are looking to do this automatically, then you should be able to follow the instructions on &lt;A href="https://answers.splunk.com/answers/2889/automatically-extract-xml-key-value-pairs.html"&gt;this answer&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Hope these help&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 17:55:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374410#M110052</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2017-10-04T17:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Windows fields at search time using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374411#M110053</link>
      <description>&lt;P&gt;At search time I need to search for previous events and also I have to add them at indexing data for new data &lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 17:56:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374411#M110053</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2017-10-04T17:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Windows fields at search time using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374412#M110054</link>
      <description>&lt;P&gt;Try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yoursearch&amp;gt; | rex field=description "Security ID:\s+(?P&amp;lt;securityid&amp;gt;.*)[\s\S]+?Account Name:\s+(?P&amp;lt;accountname&amp;gt;.*)[\s\S]+?Account Domain:\s+(?P&amp;lt;accountdomain&amp;gt;.*)[\s\S]+?Login ID:\s+(?P&amp;lt;loginid&amp;gt;.*)[\s\S]+?Provider Name:\s+(?P&amp;lt;providername&amp;gt;.*)[\s\S]+?Algorithm Name:\s+(?P&amp;lt;algname&amp;gt;.*)[\s\S]+?Key Type:\s+(?P&amp;lt;keytype&amp;gt;.*)[\s\S]+?Operation:[\s\S]+?Operation:\s+(?P&amp;lt;operation&amp;gt;.*)[\s\S]+?Return Code:\s+(?P&amp;lt;returncode&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since you provided a screenshot, I'm not sure if I got all the spacing, etc. right, but it should work for you.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 18:07:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374412#M110054</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-10-04T18:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Windows fields at search time using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374413#M110055</link>
      <description>&lt;P&gt;Thanks cpetterborg! its working, is there a way I can use splunk add-on for windows for these logs OR how can I parse them at indexing time?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 15:30:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374413#M110055</guid>
      <dc:creator>knalla</dc:creator>
      <dc:date>2017-10-06T15:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Windows fields at search time using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374414#M110056</link>
      <description>&lt;P&gt;I'm not sure if you can use them with the Splunk Add-On for Windows or not.&lt;/P&gt;

&lt;P&gt;If you really want to do the field extractions at index time (best practice is to do it at search time), then you could put something like this in your &lt;CODE&gt;transforms.conf&lt;/CODE&gt; file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_extraction]
REGEX = Security ID:\s+(?P&amp;lt;securityid&amp;gt;.*)[\s\S]+?Account Name:\s+(?P&amp;lt;accountname&amp;gt;.*)[\s\S]+?Account Domain:\s+(?P&amp;lt;accountdomain&amp;gt;.*)[\s\S]+?Login ID:\s+(?P&amp;lt;loginid&amp;gt;.*)[\s\S]+?Provider Name:\s+(?P&amp;lt;providername&amp;gt;.*)[\s\S]+?Algorithm Name:\s+(?P&amp;lt;algname&amp;gt;.*)[\s\S]+?Key Type:\s+(?P&amp;lt;keytype&amp;gt;.*)[\s\S]+?Operation:[\s\S]+?Operation:\s+(?P&amp;lt;operation&amp;gt;.*)[\s\S]+?Return Code:\s+(?P&amp;lt;returncode&amp;gt;.*)
FORMAT = securityid::"$1" accountname::"$2" accountdomain::"$3" loginid::"$4" providername::"$5" algname="$6" keytype="$7" operation::"$8" returncode::"$9"
WRITE_META = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and this in the &lt;CODE&gt;props.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_source_type]
TRANSFORM-extract-fields = my_extraction
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and this in fields.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[securityid]
INDEXED=true
[accountname]
INDEXED=true
[accountdomain]
INDEXED=true
[loginid]
INDEXED=true
[providername]
INDEXED=true
[algname]
INDEXED=true
[keytype]
INDEXED=true
[operation]
INDEXED=true
[returncode]
INDEXED=true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 16:57:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374414#M110056</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-10-06T16:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Windows fields at search time using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374415#M110057</link>
      <description>&lt;P&gt;What is the outcome of your efforts?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 18:58:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Windows-fields-at-search-time-using-regex/m-p/374415#M110057</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-10-16T18:58:55Z</dc:date>
    </item>
  </channel>
</rss>

