<?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 Delete Duplicate Events in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74178#M15161</link>
    <description>&lt;P&gt;Perfect...YTMND&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2011 03:22:49 GMT</pubDate>
    <dc:creator>I-Man</dc:creator>
    <dc:date>2011-04-05T03:22:49Z</dc:date>
    <item>
      <title>How to Delete Duplicate Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74176#M15159</link>
      <description>&lt;P&gt;We have a search that captures the count per host every 10 minutes and puts the results into a summary index. For some reason an event for a single host count during a 10 minute time period was indexed 27 times. Every event is exactly the same. So in order to correct our stats, 26 of these events need to be deleted...How do i do that? I tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | head 26 | delete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This returned an error:
Error in 'delete' command: This command cannot be invoked after the non-streaming command 'head'.&lt;/P&gt;

&lt;P&gt;Again, I have 27 events that are exactly the same. How can i delete all except 1? Thanks in advance for any help.&lt;/P&gt;

&lt;P&gt;I-Man&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2011 01:46:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74176#M15159</guid>
      <dc:creator>I-Man</dc:creator>
      <dc:date>2011-04-05T01:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete Duplicate Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74177#M15160</link>
      <description>&lt;P&gt;I-Man,&lt;/P&gt;

&lt;P&gt;If these 27 events are identical and you need to delete 26 of them I would recommend this approach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1.  Determine the "event_id" of the event you would like to keep.  To do this, perform your search with the following eval statement to create a unique identifier:
&amp;lt;my 27 events&amp;gt; | eval event_id=splunk_server."@@".index."@@"._cd

2.  Delete the other 26 events "NOT event_id=&amp;lt;your_event_id&amp;gt;":
&amp;lt;my 27 events&amp;gt; | eval event_id=splunk_server."@@".index."@@"._cd | search NOT event_id=macfish@@_internal@@2:1309157 | delete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;CAUTION:  Make sure the first part of your search identifies only the 27 events you are interested in deleting....or the "search NOT event_id=" will delete more than expected.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2011 02:56:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74177#M15160</guid>
      <dc:creator>hazekamp</dc:creator>
      <dc:date>2011-04-05T02:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete Duplicate Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74178#M15161</link>
      <description>&lt;P&gt;Perfect...YTMND&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2011 03:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74178#M15161</guid>
      <dc:creator>I-Man</dc:creator>
      <dc:date>2011-04-05T03:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete Duplicate Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74179#M15162</link>
      <description>&lt;P&gt;Would it be possible to run this search across the board and delete the output from:&lt;/P&gt;

&lt;P&gt;soucetype="ds*" | stats count values(host) values(source) values(sourcetype) by _raw | where count &amp;gt; 1&lt;/P&gt;

&lt;P&gt;Also, could one run a search and output that into a table and then proceed to do deletions?&lt;/P&gt;

&lt;P&gt;Thank you, we are stuck this side!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 15:07:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74179#M15162</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2012-10-24T15:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete Duplicate Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74180#M15163</link>
      <description>&lt;P&gt;To remove duplicate events with different timestamps it is possible using a subsearch and dedup:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=fs_notification NOT [search sourcetype=fs_notification | dedup path action modtime sortby +_time] | delete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will remove duplicated fs change events that have different timestamps, the same path, action and modtime whilst keeping the oldest.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 17:34:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74180#M15163</guid>
      <dc:creator>roryab</dc:creator>
      <dc:date>2012-11-30T17:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete Duplicate Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74181#M15164</link>
      <description>&lt;P&gt;If you want the last why not just do | tail 1 ?&lt;BR /&gt;
And with that you have the last event&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 10:24:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74181#M15164</guid>
      <dc:creator>joao_amorim</dc:creator>
      <dc:date>2015-07-10T10:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete Duplicate Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74182#M15165</link>
      <description>&lt;P&gt;Error in 'delete' command: This command cannot be invoked after the non-streaming command 'tail'.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 05:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Delete-Duplicate-Events/m-p/74182#M15165</guid>
      <dc:creator>vinkumar_splunk</dc:creator>
      <dc:date>2018-07-13T05:08:44Z</dc:date>
    </item>
  </channel>
</rss>

