<?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 event contains same field  with different values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427943#M169096</link>
    <description>&lt;P&gt;My events contain teh same fieldnames multiple times with different values.&lt;BR /&gt;
I.E.&lt;BR /&gt;
&amp;lt; active_recip="9" deliv_recip="0" hard_bounced="4" hostname="clnpniv.local *" soft_bounced="0"/&amp;gt; &lt;BR /&gt;
&amp;lt; active_recip="3" deliv_recip="0" hard_bounced="1" hostname="clnpdmz.local *" soft_bounced="0"/&amp;gt; &lt;/P&gt;

&lt;P&gt;I tried a field extraction but then only one value is recognized as a field. How can I solve this? I searched online voor MV etc. but I am a bit stuck&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 19:45:40 GMT</pubDate>
    <dc:creator>Mike6960</dc:creator>
    <dc:date>2020-09-29T19:45:40Z</dc:date>
    <item>
      <title>event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427943#M169096</link>
      <description>&lt;P&gt;My events contain teh same fieldnames multiple times with different values.&lt;BR /&gt;
I.E.&lt;BR /&gt;
&amp;lt; active_recip="9" deliv_recip="0" hard_bounced="4" hostname="clnpniv.local *" soft_bounced="0"/&amp;gt; &lt;BR /&gt;
&amp;lt; active_recip="3" deliv_recip="0" hard_bounced="1" hostname="clnpdmz.local *" soft_bounced="0"/&amp;gt; &lt;/P&gt;

&lt;P&gt;I tried a field extraction but then only one value is recognized as a field. How can I solve this? I searched online voor MV etc. but I am a bit stuck&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427943#M169096</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2020-09-29T19:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427944#M169097</link>
      <description>&lt;P&gt;You can do the extraction using props/transforms and add the &lt;CODE&gt;MV_ADD = true&lt;/CODE&gt; in the transforms.conf&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_extraction]
REGEX = &amp;lt;regular expression&amp;gt;
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]

REPORT-my_extraction = my_extraction
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Jun 2018 11:01:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427944#M169097</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2018-06-04T11:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427945#M169098</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Your issue should be solved using this - &lt;BR /&gt;
max_match&lt;BR /&gt;
Syntax: max_match=&lt;BR /&gt;
Description: Controls the number of times the regex is matched. If greater than 1, the resulting fields are multivalued fields.&lt;BR /&gt;
Default: 1, use 0 to mean unlimited.&lt;BR /&gt;
Ref. &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Rex" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Rex&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;just append max_match=0 to your rex and it should fetch all values for the same regex field&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:45:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427945#M169098</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-29T19:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427946#M169099</link>
      <description>&lt;P&gt;append max_match=0 ?. Where? In the fieldextraction editor?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 11:26:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427946#M169099</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2018-06-04T11:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427947#M169100</link>
      <description>&lt;P&gt;refer to the documentation above -&lt;BR /&gt;
something like&lt;BR /&gt;
    sourcetype=linux_secure port "failed password" | rex "\s+(?&lt;PORTS&gt;port \d+)"  max_match=0 | stats &lt;BR /&gt;
so in this case your extracted field , ports, if there are more than one value for ports ALL of them will be fetched under ports.&lt;BR /&gt;
You can re-use the field extractor regex if you don;t want to write your own regex , and similarly replace the above rex with the rex generated by the field extractor appended by max_match=0&lt;/PORTS&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:45:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427947#M169100</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-29T19:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427948#M169101</link>
      <description>&lt;P&gt;Ok, I understand what you, but when I use the regex from the editor then I get the message 'unbalanced quotes' &lt;BR /&gt;
Here is the rex:&lt;BR /&gt;
^&amp;lt;\?\w+\s+\w+="\d+.\d+"\s+\w+="\w+-\d+"\s+\w+="\w+"\?&amp;gt;\s+&amp;lt;\w+\s+\w+&lt;EM&gt;\w+="\w+&lt;/EM&gt;\w+"\s+\w+="\w+\s+\d+.\d+.\d+-\d+"\s+\w+="\w+.\w+.\w+"\s+\w+="\d+"&amp;gt;\s+&amp;lt;\w+&lt;EM&gt;\w+\s+\w+&lt;/EM&gt;\w+="\d+"\s+\w+&lt;EM&gt;\w+="\d+"\s+\w+&lt;/EM&gt;\w+="\d+"\s+\w+_\w+="\d+"\s+\w+="(?P[^*]+)&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 12:02:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427948#M169101</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2018-06-04T12:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427949#M169102</link>
      <description>&lt;P&gt;do we only need to extract active_recip to soft_bounced, ie, the 4-5 fileds as shown in your sample events?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:45:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427949#M169102</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-29T19:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427950#M169103</link>
      <description>&lt;P&gt;No, I need to extract the values for hard_bounced en for hostname&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 15:21:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427950#M169103</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2018-06-04T15:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427951#M169104</link>
      <description>&lt;P&gt;Try this - &lt;CODE&gt;&amp;lt;your index&amp;gt;|rex field=_raw "hard_bounced=\"+(?&amp;lt;hard&amp;gt;.*?)\"+" max_match=0 | rex field=_raw "hostname=\"+(?&amp;lt;hostname&amp;gt;.*?)\"+" max_match=0 | table hard,hostname&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 15:41:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427951#M169104</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-04T15:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427952#M169105</link>
      <description>&lt;P&gt;On second thoughts you might want them in separate row , try this if that is the case&lt;CODE&gt;| rex field=_raw "hard_bounced=\"+(?.*?)\"+" max_match=0 | rex field=_raw "hostname=\"+(?.*?)\"+" max_match=0 | eval fields = mvzip(hard,hostname) &lt;BR /&gt;
| mvexpand fields &lt;BR /&gt;
| rex field=fields "(?\w+),(?\w+)" &lt;BR /&gt;
| table _time hard hostname&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
Try both this one and the above..one of this is what you need&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 16:06:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427952#M169105</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-04T16:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427953#M169106</link>
      <description>&lt;P&gt;Hai @Sukisen1981 , if I use the second one I get the message 'Error in 'rex' command: Encountered the following error while compiling the regex 'hard_bounced="+(?.?)"+': Regex: unrecognized character after (? or (?- '&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 08:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427953#M169106</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2018-06-12T08:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427954#M169107</link>
      <description>&lt;P&gt;Hi, the code  got corrupted while copying, essentially the second query is the same as the first one till mvzip starts...use this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your index&amp;gt;|rex field=_raw "hard_bounced=\"+(?&amp;lt;hard&amp;gt;.*?)\"+" max_match=0 | rex field=_raw "hostname=\"+(?&amp;lt;hostname&amp;gt;.*?)\"+" max_match=0 | eval fields = mvzip(hard,hostname) 
| mvexpand fields 
| rex field=fields "(?\w+),(?\w+)" 
| table _time hard hostname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just try to fit the entire code in a continuous line, if you encounter errors., this will work&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 16:10:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427954#M169107</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-12T16:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427955#M169108</link>
      <description>&lt;P&gt;sadly, still the same error. Don't see a difference between the codes by the way&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 08:47:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427955#M169108</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2018-06-13T08:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427956#M169109</link>
      <description>&lt;P&gt;Hi - Sorry , I once again copied the same code....i am pasting the correct code now. The difference is in the rex field statement, before \w+ the individual field names have to be mentioned, it is just  a minor rex syntax issue. &lt;BR /&gt;
I apologise once again for pasting the same wrong code twice&lt;CODE&gt;|rex field=_raw "hard_bounced=\"+(?.*?)\"+" max_match=0 | rex field=_raw "hostname=\"+(?.*?)\"+" max_match=0 | eval fields = mvzip(hard,hostname) &lt;BR /&gt;
| mvexpand fields &lt;BR /&gt;
| rex field=fields "(?\w+),(?\w+)" &lt;BR /&gt;
| table _time hard hostname&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 09:45:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427956#M169109</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-15T09:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427957#M169110</link>
      <description>&lt;P&gt;i see it again the code is not getting pasted properly again.....look at the below&lt;/P&gt;

&lt;P&gt;| rex field=_raw "hard_bounced=\"+(?.&lt;EM&gt;?)\"+" max_match=0 | rex field=_raw "hostname=\"+(?.&lt;/EM&gt;?)\"+" max_match=0 | eval fields = mvzip(hard,hostname) &lt;BR /&gt;
| mvexpand fields &lt;BR /&gt;
| rex field=fields "(?\w+),(?\w+)" &lt;BR /&gt;
| table _time hard hostname&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:00:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427957#M169110</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-29T20:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427958#M169111</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "hard_bounced=\"+(?&amp;lt;hard&amp;gt;.*?)\"+" max_match=0 | rex field=_raw "hostname=\"+(?&amp;lt;hostname&amp;gt;.*?)\"+" max_match=0 | eval fields = mvzip(hard,hostname) 
| mvexpand fields 
| rex field=fields "(?&amp;lt;hard&amp;gt;\w+),(?&amp;lt;hostname&amp;gt;\w+)" 
| table _time hard hostname
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Jun 2018 09:48:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427958#M169111</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-15T09:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: event contains same field  with different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427959#M169112</link>
      <description>&lt;P&gt;Finally- the above one should work..for some reason 'hard' and 'hostname' got missed out even after applying it within the code blocks, i dunno why !&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 09:49:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/event-contains-same-field-with-different-values/m-p/427959#M169112</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-15T09:49:37Z</dc:date>
    </item>
  </channel>
</rss>

