<?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 Dedup and multivalued fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dedup-and-multivalued-fields/m-p/56085#M13701</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am extracting a few user names from a multiple line log, using MV_ADD=true in transforms.conf and KV_MODE = multi in transforms.  The search results look great, and are what I am expecting; a single event per user found.&lt;/P&gt;

&lt;P&gt;However, when I attempt to dedup the users, I run into problems.  The user names are no longer individual events, but are consolidated into the original event.  For instance, lets pretend that these are the three logs that I am searching:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username: rabbit
Username: snail
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username: rabbit
Username: turtle
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username: rabbit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;When I attempt to dedup the user name, I get:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rabbit, snail
rabbit, turtle
rabbit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I am expecting:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rabbit
snail
turtle
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I thought that the problem would be resolved by using "multi: invokes multikv to expand a tabular event into multiple events" in props, but it does not.&lt;/P&gt;

&lt;P&gt;Any ideas?  I could always pre-process the data, but I was hoping to do it all in Splunk.&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2011 04:33:37 GMT</pubDate>
    <dc:creator>jamesdon</dc:creator>
    <dc:date>2011-03-09T04:33:37Z</dc:date>
    <item>
      <title>Dedup and multivalued fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-and-multivalued-fields/m-p/56085#M13701</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am extracting a few user names from a multiple line log, using MV_ADD=true in transforms.conf and KV_MODE = multi in transforms.  The search results look great, and are what I am expecting; a single event per user found.&lt;/P&gt;

&lt;P&gt;However, when I attempt to dedup the users, I run into problems.  The user names are no longer individual events, but are consolidated into the original event.  For instance, lets pretend that these are the three logs that I am searching:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username: rabbit
Username: snail
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username: rabbit
Username: turtle
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username: rabbit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;When I attempt to dedup the user name, I get:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rabbit, snail
rabbit, turtle
rabbit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I am expecting:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rabbit
snail
turtle
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I thought that the problem would be resolved by using "multi: invokes multikv to expand a tabular event into multiple events" in props, but it does not.&lt;/P&gt;

&lt;P&gt;Any ideas?  I could always pre-process the data, but I was hoping to do it all in Splunk.&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2011 04:33:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-and-multivalued-fields/m-p/56085#M13701</guid>
      <dc:creator>jamesdon</dc:creator>
      <dc:date>2011-03-09T04:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup and multivalued fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-and-multivalued-fields/m-p/56086#M13702</link>
      <description>&lt;P&gt;You have a couple choices here:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Use &lt;CODE&gt;... | mvexpand username&lt;/CODE&gt; to break each event into a distinct event per username, duplicating the message, followed by the dedup to find the most recent per username.&lt;/LI&gt;
&lt;LI&gt;Use &lt;CODE&gt;... | stats count by username | fields username&lt;/CODE&gt; to just aggregate the list of username values.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;The first is better if you want to see the original messages, but is less efficient than the second, which is better for just finding the user list.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2011 06:56:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-and-multivalued-fields/m-p/56086#M13702</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2011-03-09T06:56:32Z</dc:date>
    </item>
  </channel>
</rss>

