<?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: how to get a count with dedup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-count-with-dedup/m-p/588330#M204898</link>
    <description>&lt;P&gt;In order to get the count of events and do dedup at the same time, you could do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* &amp;lt;do search&amp;gt; 
| stats latest(*) as * count as duplicates by B C 
| table _time B C D E F J duplicates
| eval duplicates = duplicates - 1
| sort - _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This should give you what you want - remember that dedup will normally give you the latest event from any duplicates, hence using latest(*).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 04:43:27 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-03-10T04:43:27Z</dc:date>
    <item>
      <title>How to get a count with dedup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-count-with-dedup/m-p/588328#M204897</link>
      <description>&lt;P&gt;i have the following in a statistical table on a dashboard&lt;/P&gt;
&lt;P&gt;index=* &amp;lt;do search&amp;gt; | dedup B C | table _time B C D E F J | sort-_time&lt;/P&gt;
&lt;P&gt;I would like to have a count at the end of each row telling how many it deduped.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 05:07:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-count-with-dedup/m-p/588328#M204897</guid>
      <dc:creator>tazzvon</dc:creator>
      <dc:date>2022-03-10T05:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a count with dedup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-count-with-dedup/m-p/588330#M204898</link>
      <description>&lt;P&gt;In order to get the count of events and do dedup at the same time, you could do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* &amp;lt;do search&amp;gt; 
| stats latest(*) as * count as duplicates by B C 
| table _time B C D E F J duplicates
| eval duplicates = duplicates - 1
| sort - _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This should give you what you want - remember that dedup will normally give you the latest event from any duplicates, hence using latest(*).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 04:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-count-with-dedup/m-p/588330#M204898</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-03-10T04:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a count with dedup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-count-with-dedup/m-p/588349#M204903</link>
      <description>&lt;P&gt;Actually, dedup will give you the first event it finds in the event pipeline for each unique set of values.&lt;/P&gt;&lt;P&gt;This is often the same as latest because the events returned by the search are often in descending time order (but it depends on what else is in the search before the dedup).&lt;/P&gt;&lt;P&gt;The other thing is that _time (and other fields beginning with _) as not included in * so these should be explicitly catered for.&lt;/P&gt;&lt;P&gt;A more accurate way to do this might be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* &amp;lt;do search&amp;gt; 
| stats first(*) as * first(_time) as _time count as duplicates by B C
| table _time B C D E F J duplicates
| eval duplicates = duplicates - 1
| sort - _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 07:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-count-with-dedup/m-p/588349#M204903</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-10T07:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a count with dedup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-count-with-dedup/m-p/588859#M205077</link>
      <description>&lt;P&gt;Good clarification&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;about event ordering rather than the simple _time based default&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 00:50:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-count-with-dedup/m-p/588859#M205077</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-03-14T00:50:49Z</dc:date>
    </item>
  </channel>
</rss>

