<?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 write regex or MV command to extract multiple values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159563#M45040</link>
    <description>&lt;P&gt;If that is how your raw data looks like you probably want to use the extract command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | extract pairdelim=",", kvdelim="=" mv_add=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Extract"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Extract&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Aug 2015 17:24:15 GMT</pubDate>
    <dc:creator>bmacias84</dc:creator>
    <dc:date>2015-08-03T17:24:15Z</dc:date>
    <item>
      <title>How to write regex or MV command to extract multiple values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159562#M45039</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a list of Locate ID's (below) that are contained within a single event in Splunk. I am trying to create regex to pull the values out and list all of them into 1 specified field. The problem is that the numbers vary(locateIds_4, locateIds_7, etc..)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;locateIds_0=135cc17a-44ce-4318-abce-e1ffc8652c91, locateIds_4=c296725b-1cca-495d-87cf-962fc6c7a0a0, locateIds_3=874d96b2-eee0-4e85-800b-4b6003a0fed5, locateIds_2=4c5e3c30-d43d-49c1-bbcd-77264221393f, locateIds_1=a60587d4-e709-468f-a85d-d6c4389e83f8, locateIds_6=a6676901-37c8-4a05-ac79-765ebccaadef, locateIds_5=4446b0ca-0c1e-4ea5-b474-375235e10a6f
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The regex I have is:  &lt;CODE&gt;rex field=_raw "(?i) .*?: \{(?P&amp;amp;lt;FIELDNAME3&amp;amp;gt;[[a-z]+_[0-100]])"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I cannot seem to capture the right way to extract ONLY the located ID even if the number(s) change.  Also, would the mv command be useful as well?  I have not used it before so any feedback is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159562#M45039</guid>
      <dc:creator>pmcfadden91</dc:creator>
      <dc:date>2020-09-29T06:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex or MV command to extract multiple values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159563#M45040</link>
      <description>&lt;P&gt;If that is how your raw data looks like you probably want to use the extract command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | extract pairdelim=",", kvdelim="=" mv_add=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Extract"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Extract&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 17:24:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159563#M45040</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2015-08-03T17:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex or MV command to extract multiple values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159564#M45041</link>
      <description>&lt;P&gt;Here's how you'd do it with a regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw max_match=100 "(?:locateIds_\d{1,2}=)(?&amp;lt;fieldName&amp;gt;[^,\s]*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Aug 2015 18:25:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159564#M45041</guid>
      <dc:creator>hogan24</dc:creator>
      <dc:date>2015-08-03T18:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex or MV command to extract multiple values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159565#M45042</link>
      <description>&lt;P&gt;This will not work. Since the attribute name is different for each pair, the extract will not combine all localeIDs into 1.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 19:06:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159565#M45042</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-03T19:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex or MV command to extract multiple values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159566#M45043</link>
      <description>&lt;P&gt;Thanks! I was just reading up on the possibilities of regex with setting a match when I saw this.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 19:17:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-or-MV-command-to-extract-multiple-values/m-p/159566#M45043</guid>
      <dc:creator>pmcfadden91</dc:creator>
      <dc:date>2015-08-03T19:17:57Z</dc:date>
    </item>
  </channel>
</rss>

