<?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 the fields from Message in WinEventLog? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-extract-the-fields-from-Message-in-WinEventLog/m-p/546058#M9800</link>
    <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="a$1,b$2"
| rex field=test max_match=0 "((?&amp;lt;field&amp;gt;[^$]*)\$(?&amp;lt;value&amp;gt;[^,]*),?)"

| eval fieldvalue=mvzip(field,value,"=")
| mvexpand fieldvalue
| eval field=mvindex(split(fieldvalue,"="),0)
| eval value=mvindex(split(fieldvalue,"="),1)
| eval {field}=value
| fields - field value fieldvalue test&lt;/LI-CODE&gt;&lt;P&gt;This will create separate events for each field/value pair. If you want to recombine them back to their original events, if you don't already have a field with a unique value in, you could use streamstats to add a row number to the events before the mvexpand, then use a stats command with values(*) as * by row to recombine them.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 17:43:35 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-03-30T17:43:35Z</dc:date>
    <item>
      <title>How to extract the fields from Message in WinEventLog?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-extract-the-fields-from-Message-in-WinEventLog/m-p/546041#M9799</link>
      <description>&lt;P&gt;We are trying to to extract the fields from Message in WinEventLog in the Avecto data.&lt;/P&gt;&lt;P&gt;The data looks like -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; Process Id: 21592
 Parent Process Id: 24704
 Workstyle: Avecto Defendpoint.Systems Employees
 Application Group: Avecto Defendpoint.Add Admin - Privileged Users - Applications
 Reason: &amp;lt;None&amp;gt;
 File Name: &amp;lt;file name&amp;gt;
 Hash: 4478EBABE67B50EB111D59F95FE029D31329F1FC
 Certificate: &amp;lt;name&amp;gt;
 Description: Command line runner
 Application Type: exe
 Product Name: IntelliJ Platform
 Product Code: &amp;lt;None&amp;gt;
 Upgrade Code: &amp;lt;None&amp;gt;
 ....&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each line in Message has a name value pair, separated by a colon.&lt;/P&gt;&lt;P&gt;The documentation at &lt;A title="Rex doc" href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Rex" target="_self"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Rex&lt;/A&gt; shows -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="a$1,b$2"
| rex field=test max_match=0 "((?&amp;lt;field&amp;gt;[^$]*)\$(?&amp;lt;value&amp;gt;[^,]*),?)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which works.&lt;/P&gt;&lt;P&gt;The similar one I did for Avecto works fine -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = &amp;lt;avecto index&amp;gt; Message=* 
| rex field=Message max_match=0 "((?&amp;lt;field&amp;gt;.+)\:(?&amp;lt;value&amp;gt;.+),?)" 
| table Message field value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We end up with field a and value, each is a multi-value field.&lt;/P&gt;&lt;P&gt;Is there a way to change so, we'll have multiple fields, each with its own name/value pair, such as Process_Id having 21592 as its value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 16:32:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-extract-the-fields-from-Message-in-WinEventLog/m-p/546041#M9799</guid>
      <dc:creator>danielbb</dc:creator>
      <dc:date>2021-03-30T16:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the fields from Message in WinEventLog?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-extract-the-fields-from-Message-in-WinEventLog/m-p/546058#M9800</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="a$1,b$2"
| rex field=test max_match=0 "((?&amp;lt;field&amp;gt;[^$]*)\$(?&amp;lt;value&amp;gt;[^,]*),?)"

| eval fieldvalue=mvzip(field,value,"=")
| mvexpand fieldvalue
| eval field=mvindex(split(fieldvalue,"="),0)
| eval value=mvindex(split(fieldvalue,"="),1)
| eval {field}=value
| fields - field value fieldvalue test&lt;/LI-CODE&gt;&lt;P&gt;This will create separate events for each field/value pair. If you want to recombine them back to their original events, if you don't already have a field with a unique value in, you could use streamstats to add a row number to the events before the mvexpand, then use a stats command with values(*) as * by row to recombine them.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 17:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-extract-the-fields-from-Message-in-WinEventLog/m-p/546058#M9800</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-30T17:43:35Z</dc:date>
    </item>
  </channel>
</rss>

