<?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 Multi-value Field extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153703#M43158</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I would like to create a multi-value field for my data, how can i do that?&lt;/P&gt;

&lt;P&gt;here's a sample of my data (Starts at QAM)&lt;/P&gt;

&lt;P&gt;event1 = QAM 32209 Prog 238 Path PATH_MW &lt;/P&gt;

&lt;P&gt;event2 = QAM 23001 Prog 25 Path PATH_MG PATH_VERTE &lt;/P&gt;

&lt;P&gt;event3 = QAM 46201 Prog 180 Path PATH_MD_1 PATH_JAUNE &lt;/P&gt;

&lt;P&gt;The field i am trying to extract is Path but as you can see in the sample above, path can have a single value in the case of event1(PATH_MW) or multiple values in the case of event2 (PATH _MG PATH _VERTE) and event3 (PATH _MD _1 PATH _JAUNE)&lt;/P&gt;

&lt;P&gt;This regular expression finds them but considers multiple values as one  (?i) Path (?P&lt;FIELDNAME&gt;[a-z_&lt;EM&gt;]+.&lt;/EM&gt;[a-z_&lt;EM&gt;]&lt;/EM&gt;)&lt;/FIELDNAME&gt;&lt;/P&gt;

&lt;P&gt;Here the values for event 2 and 3 are considered as one even if we have two values, what can i do so that it stores the two values in the path field for the same event but see them as two different values.&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 15:21:20 GMT</pubDate>
    <dc:creator>tallasky</dc:creator>
    <dc:date>2020-09-28T15:21:20Z</dc:date>
    <item>
      <title>Multi-value Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153703#M43158</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I would like to create a multi-value field for my data, how can i do that?&lt;/P&gt;

&lt;P&gt;here's a sample of my data (Starts at QAM)&lt;/P&gt;

&lt;P&gt;event1 = QAM 32209 Prog 238 Path PATH_MW &lt;/P&gt;

&lt;P&gt;event2 = QAM 23001 Prog 25 Path PATH_MG PATH_VERTE &lt;/P&gt;

&lt;P&gt;event3 = QAM 46201 Prog 180 Path PATH_MD_1 PATH_JAUNE &lt;/P&gt;

&lt;P&gt;The field i am trying to extract is Path but as you can see in the sample above, path can have a single value in the case of event1(PATH_MW) or multiple values in the case of event2 (PATH _MG PATH _VERTE) and event3 (PATH _MD _1 PATH _JAUNE)&lt;/P&gt;

&lt;P&gt;This regular expression finds them but considers multiple values as one  (?i) Path (?P&lt;FIELDNAME&gt;[a-z_&lt;EM&gt;]+.&lt;/EM&gt;[a-z_&lt;EM&gt;]&lt;/EM&gt;)&lt;/FIELDNAME&gt;&lt;/P&gt;

&lt;P&gt;Here the values for event 2 and 3 are considered as one even if we have two values, what can i do so that it stores the two values in the path field for the same event but see them as two different values.&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:21:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153703#M43158</guid>
      <dc:creator>tallasky</dc:creator>
      <dc:date>2020-09-28T15:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-value Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153704#M43159</link>
      <description>&lt;P&gt;the rex command has a max_matches option so you could try something like:&lt;/P&gt;

&lt;P&gt;| rex "Path (?&lt;TEMPORARY_FIELD&gt;.*)" | rex field=temporary_field max_match=10 "(?&lt;MV_FIELD&gt;[a-z_]+)"&lt;/MV_FIELD&gt;&lt;/TEMPORARY_FIELD&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;  &lt;/P&gt;

&lt;P&gt;To do this automatically you will have to use the regular expression in a configs file called &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/propsconf" target="_blank"&gt;props.conf&lt;/A&gt; &amp;amp; &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/transformsconf" target="_blank"&gt;transforms.conf&lt;/A&gt;. You can place those files in $SPLUNK_HOME/etc/system/local to start. &lt;BR /&gt;
props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]
TRANSFORMS-tempfield = tempfield
TRANSFORMS-mv_field = mv_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[tempfield]
REGEX=Path (.*)
FORMAT=temporary_field::$1

[mv_field]
SOURCE_KEY=temporary_field
REGEX=([a-z_]+)
FORMAT=mv_field::$1
MV_ADD=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There is more information here &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles" target="_blank"&gt;--&amp;gt; documentation&lt;/A&gt;. I also suggest that you read about &lt;A href="http://docs.splunk.com/Documentation/PCI/2.0/DataSource/CreatingaTechnologyAdd-on" target="_blank"&gt;Technology Add ons&lt;/A&gt; the ESS and PCI Apps/Suites from Splunk are built on this approach. The idea is to put all the configuration that is necessary to parse &amp;amp; extract fields for a technology into an app that can be used by all the splunk users/apps at your site. Does that make sense?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:21:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153704#M43159</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2020-09-28T15:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-value Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153705#M43160</link>
      <description>&lt;P&gt;Hi Chris, thanks for getting back to me:&lt;/P&gt;

&lt;P&gt;Now, what i'm trying to do is use the extract field option so this is done automatically with new data coming in everyday, your solution with rex implies that i have to use the search bar? i don't want that.&lt;/P&gt;

&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 16:13:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153705#M43160</guid>
      <dc:creator>tallasky</dc:creator>
      <dc:date>2013-11-25T16:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-value Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153706#M43161</link>
      <description>&lt;P&gt;Hi Chris, thanks for getting back to me:&lt;/P&gt;

&lt;P&gt;Now, what i'm trying to do is use the extract field option so this is done automatically with new data coming in everyday, your solution with rex implies that i have to use the search bar? i don't want that.&lt;/P&gt;

&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 16:13:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153706#M43161</guid>
      <dc:creator>tallasky</dc:creator>
      <dc:date>2013-11-25T16:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-value Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153707#M43162</link>
      <description>&lt;P&gt;Hi, I updated the answer let me know if this works for you&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 16:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153707#M43162</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2013-11-25T16:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-value Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153708#M43163</link>
      <description>&lt;P&gt;Hello Chris, thanks again,&lt;/P&gt;

&lt;P&gt;It's tricky to acces those files in a professional environement with many levels of security and different teams using the same Splunk, but i found a way around it:&lt;BR /&gt;
I use this regular expression (?i) Path (?P&lt;FIELDNAME&gt;[a-z_-]+.&lt;EM&gt;[a-z_-]&lt;/EM&gt;) to get my path values wheter it One(event1) or many(event2,event3) and i use the makemv function to separate them before my research by using the space between them as delimiter&lt;/FIELDNAME&gt;&lt;/P&gt;

&lt;P&gt;Sourcetype =  ...| makemv delim = " " path&lt;/P&gt;

&lt;P&gt;Thanks you.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153708#M43163</guid>
      <dc:creator>tallasky</dc:creator>
      <dc:date>2020-09-28T15:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-value Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153709#M43164</link>
      <description>&lt;P&gt;Hi, I'm glad you found a solution&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 08:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-value-Field-extraction/m-p/153709#M43164</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2013-11-26T08:45:05Z</dc:date>
    </item>
  </channel>
</rss>

