<?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 removing all elements in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dedup-removing-all-elements/m-p/741339#M240595</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/276496"&gt;@pedropiin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the stats command automatically dedups values, so you don't need to use the dedup command before the stats command.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 10 Mar 2025 16:03:21 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2025-03-10T16:03:21Z</dc:date>
    <item>
      <title>Dedup removing all elements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-removing-all-elements/m-p/741335#M240592</link>
      <description>&lt;P&gt;Hello everyone.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm dealing with a query that deals with certain "tickets" and "events", but some of them are duplicates, that's why it runs a dedup command. But there seems to be something else happening.&lt;BR /&gt;&lt;BR /&gt;The query is of the form:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main source=...
...
...
| fillnull value="[empty]"
| search tickets=***
| dedup tickets
| stats count by name, tickets
| stats sum(count) as numOfTickets by name
...
| fields name, tickets, count&lt;/LI-CODE&gt;&lt;P&gt;Listing all the events, I'm able to see that the, basically, the main duplicate events are the ones that were null and were filled with "[empty]". But, for some reason, some of the events disappear with dedup.&lt;BR /&gt;&lt;BR /&gt;In theory, dedup should remove all duplicates and maintain one, representing all of its "copies". And that happens for some "names", but not for all. During the same query, I deal with events of the category "name1" and events of the category "name2". All of theirs instances are "[empty]", and running dedup removes all instances of "name1" and maintains one of "name2", when it should maintain one of both.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Why is that happening?&lt;BR /&gt;&lt;BR /&gt;Each instance is of the form&lt;BR /&gt;" processTime | arrivalTime | name | tickets | count"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 15:24:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-removing-all-elements/m-p/741335#M240592</guid>
      <dc:creator>pedropiin</dc:creator>
      <dc:date>2025-03-10T15:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup removing all elements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-removing-all-elements/m-p/741336#M240593</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;dedup &lt;/FONT&gt;command keeps the first event it finds for each unique value of the field(s) specified in its arguments ("tickets" in this case). The values of other fields are ignored. Depending on the sequence of events, it's entirely possible for each ticket value to come first from name1 and be retained and other names will be discarded.&lt;/P&gt;&lt;P&gt;If you need to &lt;FONT face="courier new,courier"&gt;dedup&lt;/FONT&gt; on both tickets and name then use &lt;FONT face="courier new,courier"&gt;dedup tickets name&lt;/FONT&gt; in the query.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 15:53:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-removing-all-elements/m-p/741336#M240593</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2025-03-10T15:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup removing all elements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-removing-all-elements/m-p/741339#M240595</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/276496"&gt;@pedropiin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the stats command automatically dedups values, so you don't need to use the dedup command before the stats command.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 16:03:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-removing-all-elements/m-p/741339#M240595</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-03-10T16:03:21Z</dc:date>
    </item>
  </channel>
</rss>

