<?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: Extract multiple values with the same delimiter in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-values-with-the-same-delimiter/m-p/511663#M143462</link>
    <description>&lt;P&gt;This will give all log values irrespective of number logs. Trick is you need use "max_match" option with rex.&lt;/P&gt;&lt;P&gt;| makeresults | eval value= "log:word1 log:word2 log:word3" | rex field=value max_match=0 "log:(?[^ ]+)" | mvexpand LogValue | fields LogValue | fields - _*&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="spitchika_0-1596065961126.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9948i28615FDA7D2305F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="spitchika_0-1596065961126.png" alt="spitchika_0-1596065961126.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2020 23:40:21 GMT</pubDate>
    <dc:creator>spitchika</dc:creator>
    <dc:date>2020-07-29T23:40:21Z</dc:date>
    <item>
      <title>How to extract multiple values with the same delimiter?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-values-with-the-same-delimiter/m-p/511543#M143404</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I'm trying to regex my way into this puzzle, let me explain my problem.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;event 1 (field 2) raw value = log:word1 log:word2 log:word3
event 2 (field 2) raw value = log:19 log:word4&lt;/LI-CODE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;The value in field2 from the first event (raw value).
log:word1 log:word2 log:word3
The value in field2 from the second event (raw value).
log:19 log:word4&lt;/LI-CODE&gt;
&lt;P&gt;I want to extract these "log:" values into 3 fields.&lt;BR /&gt;Something like field log1 , log2 and log3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;So I tried with this regex :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;":(?&amp;lt;log1&amp;gt;\S*) log:(?&amp;lt;log2&amp;gt;\S*) log:(?&amp;lt;log3&amp;gt;\S*)"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Works perfectly with event 1, but didn't work for event 2 because there or only 2 “log:” values.&lt;BR /&gt;&lt;BR /&gt;Can anybody tell me how to make this work?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 04:58:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-values-with-the-same-delimiter/m-p/511543#M143404</guid>
      <dc:creator>christopheducha</dc:creator>
      <dc:date>2020-07-30T04:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple values with the same delimiter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-values-with-the-same-delimiter/m-p/511660#M143460</link>
      <description>&lt;P&gt;You can make the regex use quantifiers, so that 2nd and subsequent extractions are optional using ?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval v=split("log:word1 log:word2 log:word3,log:19 log:word4",",")
| mvexpand v
| rex field=v ":(?&amp;lt;log1&amp;gt;\S*)( log:(?&amp;lt;log2&amp;gt;\S*))?( log:(?&amp;lt;log3&amp;gt;\S*))?"&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 23:27:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-values-with-the-same-delimiter/m-p/511660#M143460</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-29T23:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple values with the same delimiter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-values-with-the-same-delimiter/m-p/511663#M143462</link>
      <description>&lt;P&gt;This will give all log values irrespective of number logs. Trick is you need use "max_match" option with rex.&lt;/P&gt;&lt;P&gt;| makeresults | eval value= "log:word1 log:word2 log:word3" | rex field=value max_match=0 "log:(?[^ ]+)" | mvexpand LogValue | fields LogValue | fields - _*&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="spitchika_0-1596065961126.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9948i28615FDA7D2305F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="spitchika_0-1596065961126.png" alt="spitchika_0-1596065961126.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 23:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-values-with-the-same-delimiter/m-p/511663#M143462</guid>
      <dc:creator>spitchika</dc:creator>
      <dc:date>2020-07-29T23:40:21Z</dc:date>
    </item>
  </channel>
</rss>

