<?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 Queried results from Splunk DB which are indexed? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-delete-Queried-results-from-Splunk-DB-which-are-indexed/m-p/360874#M106653</link>
    <description>&lt;P&gt;Hi, &lt;BR /&gt;
Basically Iam looking for connecting to &lt;STRONG&gt;Splunk&lt;/STRONG&gt; from Email Security Appliance, then DELETE the &lt;BR /&gt;
queried data between Time &lt;STRONG&gt;Time-1 &amp;amp; Time-2&lt;/STRONG&gt; from Splunk DB completely.&lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;
Dharmendra Setty&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2017 14:06:38 GMT</pubDate>
    <dc:creator>dhsetty</dc:creator>
    <dc:date>2017-03-21T14:06:38Z</dc:date>
    <item>
      <title>How to delete Queried results from Splunk DB which are indexed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-delete-Queried-results-from-Splunk-DB-which-are-indexed/m-p/360872#M106651</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;event_start=1
event_stop=500

search_parms = {'date_from': '1/10/2016:05:00', 'start': event_start, 'stop': event_stop, 'timeout': 60, 'date_to': '02/22/2017:23:39', 'mask_prvs': 0, 'maxresults': 100000},

SEARCH "mid=*" OR "icid=*" starttime::03/08/2017:00:00:00 endtime::03/15/2017:23:49:59maxtime::-1 maxevents::150000 GET events::101-600 OUTPUT splunkui::2.1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, the Splunk response is for the above query search.&lt;/P&gt;

&lt;P&gt;a. How to delete these results from Splunk DB which are indexed?&lt;BR /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ &lt;BR /&gt;
Below is the code snippet, which uses "api_data" &amp;amp; does a "rpc" call. Can we tweek the below code snippet for deleting the Queried data from the Splunk DB?&lt;/P&gt;

&lt;P&gt;cancel_id_token = '%s' % (cancel_id,)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    search_token = '&amp;lt;query&amp;gt;%s&amp;lt;/query&amp;gt;' % (query,)
    user_token = '&amp;lt;user&amp;gt;livesplunkuser&amp;lt;/user&amp;gt;'

    api_data = '&amp;lt;call name="executeQuery"&amp;gt; \
                    &amp;lt;params&amp;gt;' + \
                        self.auth_token + \
                        query_id_token + \
                        search_token + \
                        cancel_id_token + \
                        user_token + \
                   '&amp;lt;/params&amp;gt; \
                &amp;lt;/call&amp;gt;'

    if self.debug:
        P('api_data=%s'%(api_data,))

    try:
        self.server.request("POST", "/rpc", api_data)
        result = self.server.getresponse().read()
        return result
    except Exception, e:
        try:
            # The self.server might be used by other request, so try to use a new connection.
            server = get_proxy_server(self.url, self.port)
            server.request("POST", "/rpc", api_data)
            result = server.getresponse().read()
            server.close()
        except Exception, e:
            raise SplunkException('Could not connect to server to perform search (%s): %s'%(self.server, str(e),))
    return result
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;NOTE: &lt;BR /&gt;
1.  My another query, is there any option in api_data "call name" for deleting the query results from Splunk DB completely?&lt;BR /&gt;
2.  The above code snippet is from Email Security Appliance, which uses Splunk DB.&lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;
Dharmendra Setty&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-delete-Queried-results-from-Splunk-DB-which-are-indexed/m-p/360872#M106651</guid>
      <dc:creator>dhsetty</dc:creator>
      <dc:date>2020-09-29T13:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete Queried results from Splunk DB which are indexed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-delete-Queried-results-from-Splunk-DB-which-are-indexed/m-p/360873#M106652</link>
      <description>&lt;P&gt;You can make individual events unsearchable using the &lt;CODE&gt;delete&lt;/CODE&gt; command, (see here &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Delete"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Delete&lt;/A&gt;)  or you can delete all the events in an index using the &lt;CODE&gt;splunk clean&lt;/CODE&gt; (see here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/Admin/CLIadmincommands"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.2/Admin/CLIadmincommands&lt;/A&gt;) &lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 13:25:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-delete-Queried-results-from-Splunk-DB-which-are-indexed/m-p/360873#M106652</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-03-21T13:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete Queried results from Splunk DB which are indexed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-delete-Queried-results-from-Splunk-DB-which-are-indexed/m-p/360874#M106653</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
Basically Iam looking for connecting to &lt;STRONG&gt;Splunk&lt;/STRONG&gt; from Email Security Appliance, then DELETE the &lt;BR /&gt;
queried data between Time &lt;STRONG&gt;Time-1 &amp;amp; Time-2&lt;/STRONG&gt; from Splunk DB completely.&lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;
Dharmendra Setty&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 14:06:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-delete-Queried-results-from-Splunk-DB-which-are-indexed/m-p/360874#M106653</guid>
      <dc:creator>dhsetty</dc:creator>
      <dc:date>2017-03-21T14:06:38Z</dc:date>
    </item>
  </channel>
</rss>

