<?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 do I delete events in one index that exist in another? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158181#M44588</link>
    <description>&lt;P&gt;Holy cow! I know I'm very new to Splunk but I can't believe I haven't seen that yet, especially with all the reading up I did on the join command. That certainly allays my fears. Thanks for the reference!&lt;/P&gt;</description>
    <pubDate>Tue, 11 Aug 2015 00:11:03 GMT</pubDate>
    <dc:creator>kmcarrol</dc:creator>
    <dc:date>2015-08-11T00:11:03Z</dc:date>
    <item>
      <title>How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158173#M44580</link>
      <description>&lt;P&gt;I've read up on delete and am familiar with the implications, but I'm having trouble figuring out how to mark events for deletion that are found in another index. The idea is very simple, but doesn't work. I'm basically trying to build a master index of unique IDs based on a daily incremental update of changes and additions. Similarly, I have a log file that indicates deleted records and I'd like to join those log results and pipe to delete to clean out my reference index.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=pgbs | join type=inner Id [search index=pgbs-incremental] | delete
  index=pgbs | join type=inner Id [search index=pgbs-audit extracted_EventType="Delete Entity"] | delete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Unfortunately it seems that delete cannot be invoked after join...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  Error in 'delete' command: This command cannot be invoked after the non-streaming command 'join'.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Aug 2015 13:24:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158173#M44580</guid>
      <dc:creator>kmcarrol</dc:creator>
      <dc:date>2015-08-10T13:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158174#M44581</link>
      <description>&lt;P&gt;You can only pipe raw events to delete so try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pgbs [search index=pgbs-incremental | fields Id] | delete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pgbs [search index=pgbs-audit extracted_EventType="Delete Entity" | fields Id] | delete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Be aware that &lt;CODE&gt;delete&lt;/CODE&gt; does almost nothing useful other than prevent events from ever showing up in search results.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 17:00:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158174#M44581</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-10T17:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158175#M44582</link>
      <description>&lt;P&gt;Try this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pgbs [search index=pgbs-incremental | fields Id]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it works, then add the &lt;CODE&gt;| delete&lt;/CODE&gt; on the end. The limitation here is that subsearches have a default limit of 10,000 results. So you won't be able to delete more than 10,000 events at a time. But you could run this multiple times, choosing a smaller time range each time.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 17:33:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158175#M44582</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-08-10T17:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158176#M44583</link>
      <description>&lt;P&gt;Thanks! It isn't obvious to me why the syntax works, but it does. The alternative was that dedup would have to sift through more and more and more events. Thanks again!&lt;/P&gt;

&lt;P&gt;Thanks to lguinn as well, who mentioned the same and added the reminder of the subsearch limits. I had considered the same and I have incorporated your guidance into my process documentation.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 18:28:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158176#M44583</guid>
      <dc:creator>kmcarrol</dc:creator>
      <dc:date>2015-08-10T18:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158177#M44584</link>
      <description>&lt;P&gt;As I think about the syntax, is this a free text search that could potentially match the returned list of IDs against fields in pgbs other than ID?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 18:30:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158177#M44584</guid>
      <dc:creator>kmcarrol</dc:creator>
      <dc:date>2015-08-10T18:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158178#M44585</link>
      <description>&lt;P&gt;I told you why it does/not work.  You can only delete events which means that you cannot delete non-events.  Think about it: once you pass events into a &lt;CODE&gt;transforming&lt;/CODE&gt; &lt;CODE&gt;non-streaming&lt;/CODE&gt; command, you are no longer working with events.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 18:32:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158178#M44585</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-10T18:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158179#M44586</link>
      <description>&lt;P&gt;Yes, sorry. I understood your explanation why deleting after a join wasn't valid. What I didn't initially understand is why "index=pgbs [search index=pgbs-incremental | fields Id]" finds the records that I'm looking for since there isn't an explicit match on the Id field. I think the answer is that this syntax creates a free text search on the ID values, right? And if I happened to have another field "Previous ID" or "Reference ID" or even just a completely unrelated field with a random match, it would delete that record too, right?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 19:39:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158179#M44586</guid>
      <dc:creator>kmcarrol</dc:creator>
      <dc:date>2015-08-10T19:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158180#M44587</link>
      <description>&lt;P&gt;It is a &lt;CODE&gt;correlating&lt;/CODE&gt; subsearch:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/Search/Usesubsearchtocorrelateevents"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/Search/Usesubsearchtocorrelateevents&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 20:07:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158180#M44587</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-10T20:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158181#M44588</link>
      <description>&lt;P&gt;Holy cow! I know I'm very new to Splunk but I can't believe I haven't seen that yet, especially with all the reading up I did on the join command. That certainly allays my fears. Thanks for the reference!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 00:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158181#M44588</guid>
      <dc:creator>kmcarrol</dc:creator>
      <dc:date>2015-08-11T00:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete events in one index that exist in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158182#M44589</link>
      <description>&lt;P&gt;Also, take a look at the search job inspector when you run the search. It will often show you the "expansion" of the subsearch, and shows a lot of other useful info about your search performance. &lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 15:53:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-delete-events-in-one-index-that-exist-in-another/m-p/158182#M44589</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-08-11T15:53:13Z</dc:date>
    </item>
  </channel>
</rss>

