<?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: Dedup within a MV field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34961#M7665</link>
    <description>&lt;P&gt;I know this is an old question, but I stumbled upon this while trying to do the same thing, and there is now a much cleaner solution:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval mvfield=mvdedup(mvfield)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 10 Feb 2015 15:33:52 GMT</pubDate>
    <dc:creator>emiller42</dc:creator>
    <dc:date>2015-02-10T15:33:52Z</dc:date>
    <item>
      <title>Dedup within a MV field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34957#M7661</link>
      <description>&lt;P&gt;I need the ability to dedup a multi-value field on a per event basis. Something like values() but limited to one event at a time. The ordering within the mv doesn't matter to me, just that there aren't duplicates. Any help is greatly appreciated.&lt;/P&gt;

&lt;P&gt;My search:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;host=test* | transaction Customer maxspan=3m | eval logSplit = split(_raw,",") | eval eventSplit = mvfilter(match(logSplit, "^[E|e]vent-")) | table eventSplit&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Normal output:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;event-001 = date:02/14/2013 12:48:09 -0500|result:available_retrieve_success&lt;BR /&gt;
event-002 = date:02/14/2013 12:48:10 -0500|result:scan_success|token:uf&lt;BR /&gt;
event-003 = date:02/14/2013 12:48:11 -0500|result:retrieve_success|txType:P|txRefId:c0544ec1-bce5-4c4e-bc9d-f6e9072131ad&lt;BR /&gt;
event-001 = date:02/14/2013 12:48:09 -0500|result:available_retrieve_success&lt;BR /&gt;
event-002 = date:02/14/2013 12:48:10 -0500|result:scan_success|token:uf&lt;BR /&gt;
event-001 = date:02/13/2013 12:49:20 -0500|result:log_success&lt;BR /&gt;
event-003 = date:02/14/2013 12:48:11 -0500|result:retrieve_success|txType:P|txRefId:c0544ec1-bce5-4c4e-bc9d-f6e9072131ad&lt;BR /&gt;
event-001 = date:02/14/2013 12:48:16 -0500|result:p_success|txRefId:c0544ec1-bce5-4c4e-bc9d-f6e9072131ad|total:6.1&lt;BR /&gt;
event-001 = date:02/14/2013 12:48:16 -0500|result:p_success|txRefId:c0544ec1-bce5-4c4e-bc9d-f6e9072131ad|total:6.1&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Preferred output:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;event-001 = date:02/14/2013 12:48:09 -0500|result:available_retrieve_success&lt;BR /&gt;
event-002 = date:02/14/2013 12:48:10 -0500|result:scan_success|token:uf&lt;BR /&gt;
event-001 = date:02/13/2013 12:49:20 -0500|result:log_success&lt;BR /&gt;
event-003 = date:02/14/2013 12:48:11 -0500|result:retrieve_success|txType:P|txRefId:c0544ec1-bce5-4c4e-bc9d-f6e9072131ad&lt;BR /&gt;
event-001 = date:02/14/2013 12:48:16 -0500|result:p_success|txRefId:c0544ec1-bce5-4c4e-bc9d-f6e9072131ad|total:6.1&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 23:00:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34957#M7661</guid>
      <dc:creator>pkashou</dc:creator>
      <dc:date>2013-02-15T23:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup within a MV field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34958#M7662</link>
      <description>&lt;P&gt;You could make use of the regular dedup like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...  | streamstats count | mvexpand eventSplit | dedup count eventSplit | mvcombine eventSplit | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Feb 2013 23:19:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34958#M7662</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-15T23:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup within a MV field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34959#M7663</link>
      <description>&lt;P&gt;Another idea is to use &lt;CODE&gt;stats values()&lt;/CODE&gt;, but do a weird trick to make it calculate unique values only within each row. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| streamstats count as row_number | stats values(mvField) as mvField by row_number | fields - row_number
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Feb 2013 00:45:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34959#M7663</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-02-16T00:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup within a MV field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34960#M7664</link>
      <description>&lt;P&gt;Thanks to both of you as these both worked to a certain degree. The stats weird trick did some strangeness to the output so I ended up using the mvexpand/mvcombine approach along with eventstats.&lt;/P&gt;

&lt;P&gt;Much appreciated!&lt;/P&gt;</description>
      <pubDate>Sun, 17 Feb 2013 16:51:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34960#M7664</guid>
      <dc:creator>pkashou</dc:creator>
      <dc:date>2013-02-17T16:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup within a MV field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34961#M7665</link>
      <description>&lt;P&gt;I know this is an old question, but I stumbled upon this while trying to do the same thing, and there is now a much cleaner solution:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval mvfield=mvdedup(mvfield)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Feb 2015 15:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34961#M7665</guid>
      <dc:creator>emiller42</dc:creator>
      <dc:date>2015-02-10T15:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup within a MV field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34962#M7666</link>
      <description>&lt;P&gt;I ran into this need today and stumbled across this post...&lt;/P&gt;

&lt;P&gt;It's worth noting for anyone else who finds this post while trying to figure out how to do this that &amp;lt;code&amp;gt;mvdedup&amp;lt;/code&amp;gt; was only introduced in 6.2.0.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 19:48:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34962#M7666</guid>
      <dc:creator>redc</dc:creator>
      <dc:date>2015-05-19T19:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup within a MV field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34963#M7667</link>
      <description>&lt;P&gt;Exactly what I was looking for.&lt;/P&gt;

&lt;P&gt;Love this community.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 21:06:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-within-a-MV-field/m-p/34963#M7667</guid>
      <dc:creator>danbutterman</dc:creator>
      <dc:date>2017-12-12T21:06:05Z</dc:date>
    </item>
  </channel>
</rss>

