<?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 How to dedup a combination of two fields and get the count of unique values per host? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217968#M64059</link>
    <description>&lt;P&gt;We have devices that generate thousands of a particular entry. I created a daily search to summarize. I combined the src_int and dest_int into a single field labeled interfaces. What my boss wants is to see the total number of events per host, but only unique to the new field. The problem is he also wants to dedup the interfaces field even if the src_int and dest_int are reversed like this:&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/175172-dedup.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Here is  the current search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network  sourcetype="cisco:ios*"  (key_word="MAC_MOVE-SP-4-NOTIF" OR key_word="MAC_MOVE-SW1-4-NOTIF") 
|  eval Interfaces = src_int + "," + dest_int |  table host, Interfaces | sort host | dedup Interfaces 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I need is to somehow dedup the "Interfaces" field even if the 2 fields that make up the eval are reversed. I then need to add a count of unique "Interfaces" entries per host after the dedup. &lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 12:17:20 GMT</pubDate>
    <dc:creator>mvasquez2</dc:creator>
    <dc:date>2020-09-29T12:17:20Z</dc:date>
    <item>
      <title>How to dedup a combination of two fields and get the count of unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217968#M64059</link>
      <description>&lt;P&gt;We have devices that generate thousands of a particular entry. I created a daily search to summarize. I combined the src_int and dest_int into a single field labeled interfaces. What my boss wants is to see the total number of events per host, but only unique to the new field. The problem is he also wants to dedup the interfaces field even if the src_int and dest_int are reversed like this:&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/175172-dedup.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Here is  the current search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network  sourcetype="cisco:ios*"  (key_word="MAC_MOVE-SP-4-NOTIF" OR key_word="MAC_MOVE-SW1-4-NOTIF") 
|  eval Interfaces = src_int + "," + dest_int |  table host, Interfaces | sort host | dedup Interfaces 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I need is to somehow dedup the "Interfaces" field even if the 2 fields that make up the eval are reversed. I then need to add a count of unique "Interfaces" entries per host after the dedup. &lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217968#M64059</guid>
      <dc:creator>mvasquez2</dc:creator>
      <dc:date>2020-09-29T12:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup a combination of two fields and get the count of unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217969#M64060</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network  sourcetype="cisco:ios*"  (key_word="MAC_MOVE-SP-4-NOTIF" OR key_word="MAC_MOVE-SW1-4-NOTIF") 
 |  eval Interfaces = mvsort(split(src_int + "," + dest_int,","))| nomv interfaces |  table host, Interfaces | sort host | dedup Interfaces 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jan 2017 19:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217969#M64060</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-03T19:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup a combination of two fields and get the count of unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217970#M64061</link>
      <description>&lt;P&gt;OK. Almost there. This is awesome. All I need now is to add a column with the count of the number of events before the dedup.&lt;/P&gt;

&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 20:42:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217970#M64061</guid>
      <dc:creator>mvasquez2</dc:creator>
      <dc:date>2017-01-03T20:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup a combination of two fields and get the count of unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217971#M64062</link>
      <description>&lt;P&gt;actually it would be the # of events AFTER the dedup&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 21:11:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217971#M64062</guid>
      <dc:creator>mvasquez2</dc:creator>
      <dc:date>2017-01-03T21:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup a combination of two fields and get the count of unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217972#M64063</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=network  sourcetype="cisco:ios*"  (key_word="MAC_MOVE-SP-4-NOTIF" OR key_word="MAC_MOVE-SW1-4-NOTIF") 
  |  eval Interfaces = mvsort(split(src_int + "," + dest_int,","))| nomv interfaces |  table host, Interfaces | sort host | dedup Interfaces  | eventstats count 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jan 2017 22:59:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217972#M64063</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-03T22:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup a combination of two fields and get the count of unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217973#M64064</link>
      <description>&lt;P&gt;I had tried that but it gives the same total for each line:&lt;/P&gt;

&lt;P&gt;Host                           Interfaces   Count&lt;BR /&gt;
ns-s-972brus-6509c  Gi7/37          47&lt;BR /&gt;
                                    Po246&lt;BR /&gt;&lt;BR /&gt;
ns-s-972brus-6509c  Gi7/48          47&lt;BR /&gt;
                                    Po246&lt;BR /&gt;&lt;BR /&gt;
ns-s-972brus-6509c  Gi4/25          47&lt;BR /&gt;
                                    Po246&lt;BR /&gt;&lt;BR /&gt;
ns-s-972brus-6509c  Gi4/23          47&lt;BR /&gt;
                                    Po246   &lt;/P&gt;

&lt;P&gt;What I need is the count of the number of events for each pair of interfaces. For this search the total number of events was 47 so I would expect the count for each pair to add up to 47 total.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 14:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217973#M64064</guid>
      <dc:creator>mvasquez21</dc:creator>
      <dc:date>2017-01-04T14:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup a combination of two fields and get the count of unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217974#M64065</link>
      <description>&lt;P&gt;I should've pointed this one out, after dedup, there will be only 1 entry available for each interface, so I guess you need the count of events what was before the dedup. Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network  sourcetype="cisco:ios*"  (key_word="MAC_MOVE-SP-4-NOTIF" OR key_word="MAC_MOVE-SW1-4-NOTIF") 
   |  eval Interfaces = mvsort(split(src_int + "," + dest_int,","))| nomv interfaces | stats count latest(host) as host by Interfaces | sort host 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jan 2017 15:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217974#M64065</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-04T15:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup a combination of two fields and get the count of unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217975#M64066</link>
      <description>&lt;P&gt;Ah. I gotcha. This works though for the count. Thanks so much for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 18:37:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-a-combination-of-two-fields-and-get-the-count-of/m-p/217975#M64066</guid>
      <dc:creator>mvasquez21</dc:creator>
      <dc:date>2017-01-04T18:37:46Z</dc:date>
    </item>
  </channel>
</rss>

