<?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: Regex multiple values from a string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550362#M156175</link>
    <description>&lt;P&gt;I am not sure I understand - the first two lines just set up sample data and should be replaced by your search. You will then have a multi-value field called parts for each event returned by your search which you can then select the parts you want into different fields with the mvindex command. If that isn't what you want to do, please explain further&lt;/P&gt;</description>
    <pubDate>Tue, 04 May 2021 09:42:17 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-05-04T09:42:17Z</dc:date>
    <item>
      <title>Regex multiple values from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550346#M156171</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;How can I extract multiple values from a string after each slash? For example below, I would like to extract field1 with the value "Subscription", field2 with the value "83C4EEEF-XXOA-1234" and so on.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/SUBSCRIPTIONS/83C4EEEF-XXOA-1234/VIRTUALGROUPS/JOHN.DOE/PROVIDERS/MICROSOFT.GRAPH/DISKENCRYPTIONSETS/JOHN.DOE-TBHOST-DWS&lt;/LI-CODE&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 08:04:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550346#M156171</guid>
      <dc:creator>timyong80</dc:creator>
      <dc:date>2021-05-04T08:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Regex multiple values from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550360#M156173</link>
      <description>&lt;P&gt;You could use split instead of rex&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="/SUBSCRIPTIONS/83C4EEEF-XXOA-1234/VIRTUALGROUPS/JOHN.DOE/PROVIDERS/MICROSOFT.GRAPH/DISKENCRYPTIONSETS/JOHN.DOE-TBHOST-DWS"
| eval parts=split(_raw,"/")&lt;/LI-CODE&gt;&lt;P&gt;You end up with a multi-value field then you can use mvindex to pull out specific parts.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 09:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550360#M156173</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-04T09:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regex multiple values from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550361#M156174</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;. That looks like a hardcoded entry but the _raw column has unique values in each record. Is there a better way for this?&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 09:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550361#M156174</guid>
      <dc:creator>timyong80</dc:creator>
      <dc:date>2021-05-04T09:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex multiple values from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550362#M156175</link>
      <description>&lt;P&gt;I am not sure I understand - the first two lines just set up sample data and should be replaced by your search. You will then have a multi-value field called parts for each event returned by your search which you can then select the parts you want into different fields with the mvindex command. If that isn't what you want to do, please explain further&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 09:42:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550362#M156175</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-04T09:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Regex multiple values from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550408#M156197</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/175775"&gt;@timyong80&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try something like below search. Just go through my sample search and update as per your requirement.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="/SUBSCRIPTIONS/83C4EEEF-XXOA-1234/VIRTUALGROUPS/JOHN.DOE/PROVIDERS/MICROSOFT.GRAPH/DISKENCRYPTIONSETS/JOHN.DOE-TBHOST-DWS" | eval uq=1 | accum uq
| eval parts=split(_raw,"/")
| stats count by uq, parts | where parts!=""
| eval a=1 | accum a | eval field{a} = parts | fields - a,count, parts
| stats values(*) as * by uq&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 04 May 2021 13:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550408#M156197</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-05-04T13:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex multiple values from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550473#M156216</link>
      <description>&lt;P&gt;Sorry I misunderstood the first two lines. I've just tried it on my search and it works! I then used mvindex like you suggested to bring out the parts to each new field.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval field1=mvindex(parts,0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thank you very much sir.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 01:53:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550473#M156216</guid>
      <dc:creator>timyong80</dc:creator>
      <dc:date>2021-05-05T01:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Regex multiple values from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550474#M156217</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;! I tried the section below but the search did not complete its run. It just keeps searching. But the first 3 lines helped to get what I wanted to achieve after adding mvindex.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count by uq, parts | where parts!=""
| eval a=1 | accum a | eval field{a} = parts | fields - a,count, parts
| stats values(*) as * by uq&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thank you for your help and suggestion!&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 01:57:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-multiple-values-from-a-string/m-p/550474#M156217</guid>
      <dc:creator>timyong80</dc:creator>
      <dc:date>2021-05-05T01:57:02Z</dc:date>
    </item>
  </channel>
</rss>

