<?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: Parse multivalued field to every line in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-parse-multivalued-field-to-every-line/m-p/624046#M14787</link>
    <description>&lt;P&gt;Assuming each line in the log is a separate event then you can use the &lt;FONT face="courier new,courier"&gt;split &lt;/FONT&gt;function to separate the fields.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval policyStatus = split(PostureReport, ";")
| eval policy = mvindex(policyStatus, 0), status = mvindex(policyStatus, 1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2022 17:50:26 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-12-12T17:50:26Z</dc:date>
    <item>
      <title>How to parse multivalued field to every line?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-parse-multivalued-field-to-every-line/m-p/624045#M14786</link>
      <description>&lt;P&gt;Hello Splunkers.&lt;/P&gt;
&lt;P&gt;I need help regarding a field with multiple values that must be separated.&lt;/P&gt;
&lt;P&gt;I have the following log in the following format:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PostureReport&lt;/STRONG&gt;&lt;BR /&gt;Policy_Umbrella;Passed&lt;BR /&gt;Policy_DLP;Passed&lt;BR /&gt;Policy_Kaspersky;Passed&lt;BR /&gt;Policy_Domain;Passed&lt;BR /&gt;Policy_SCCM;Passed&lt;BR /&gt;Police_Firewall_Windows;Failed&lt;BR /&gt;Policy_Crownstrike;Passed&lt;/P&gt;
&lt;P&gt;I need to separate every Policy with your status.&lt;/P&gt;
&lt;P&gt;I tried to use mvindex, mvjoin and them separate the events, mvexpand, but none of these worked for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 02:42:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-parse-multivalued-field-to-every-line/m-p/624045#M14786</guid>
      <dc:creator>wvalente2</dc:creator>
      <dc:date>2022-12-13T02:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Parse multivalued field to every line</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-parse-multivalued-field-to-every-line/m-p/624046#M14787</link>
      <description>&lt;P&gt;Assuming each line in the log is a separate event then you can use the &lt;FONT face="courier new,courier"&gt;split &lt;/FONT&gt;function to separate the fields.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval policyStatus = split(PostureReport, ";")
| eval policy = mvindex(policyStatus, 0), status = mvindex(policyStatus, 1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 17:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-parse-multivalued-field-to-every-line/m-p/624046#M14787</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-12T17:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Parse multivalued field to every line</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-parse-multivalued-field-to-every-line/m-p/624076#M14790</link>
      <description>&lt;P&gt;Assuming the &lt;FONT color="#FF0000"&gt;Police&lt;/FONT&gt;_Firewall_Windows was Policy and it is a single field in a single event, then use rex&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=PostureReport max_match=0 "Policy_(?&amp;lt;Policy&amp;gt;[^;]*);(?&amp;lt;Status&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;which will give you two multi-value fields Policy and Status.&lt;/P&gt;&lt;P&gt;If you want to create separate events for each policy result, then do this instead&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=PostureReport max_match=0 "Policy_(?&amp;lt;Policy_Status&amp;gt;.*)"
| fields - PostureReport
| mvexpand Policy_Status
| rex field=Policy_Status "(?&amp;lt;Policy&amp;gt;[^;]*);(?&amp;lt;Status&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;which will give you a separate event per Policy/Status pair&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 22:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-parse-multivalued-field-to-every-line/m-p/624076#M14790</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-12-12T22:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Parse multivalued field to every line</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-parse-multivalued-field-to-every-line/m-p/624120#M14792</link>
      <description>&lt;P&gt;The first query work perfectly. I'll try here the final query that I want.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 11:19:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-parse-multivalued-field-to-every-line/m-p/624120#M14792</guid>
      <dc:creator>wvalente2</dc:creator>
      <dc:date>2022-12-13T11:19:32Z</dc:date>
    </item>
  </channel>
</rss>

