<?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 How to efficiently delete rows from KV Store based lookup. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-efficiently-delete-rows-from-KV-Store-based-lookup/m-p/517199#M145409</link>
    <description>&lt;P&gt;I have a lookup which is based on KV store. The lookup contains &lt;STRONG&gt;thousands of rows.&amp;nbsp;&lt;/STRONG&gt;We want to delete rows from this lookup which are older than 7 days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To give an idea this is how the lookup looks like except that it contains thousands of rows.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;my_date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;age&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Sep-1-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Rupert&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-31-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Sam&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-30-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Tony&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-29-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Prince&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;27&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-28-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Tom&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;24&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-27-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Sean&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-26-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Roger&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;21&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We keep on appending new data to this lookup on a daily basis but we don't really care about data which are 7 days old and hence want to remove those rows.&lt;/P&gt;&lt;P&gt;How do I do remove the rows efficiently from this KV store based lookup. I know the classic way to do this would be to search for rows that are newer than 7 days and output the results to the same lookup. Something like,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;inputlookup my_lookup | where date &amp;gt; now()-7 days | outputlookup my_lookup&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But given that the lookup contains tons of rows, I would like to do this efficiently and remove just the old rows instead of writing the entire result set again.&lt;/P&gt;&lt;P&gt;This should be possible with KV store but I am unable to figure out how.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Sep 2020 09:41:04 GMT</pubDate>
    <dc:creator>iet_ashish</dc:creator>
    <dc:date>2020-09-01T09:41:04Z</dc:date>
    <item>
      <title>How to efficiently delete rows from KV Store based lookup.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-efficiently-delete-rows-from-KV-Store-based-lookup/m-p/517199#M145409</link>
      <description>&lt;P&gt;I have a lookup which is based on KV store. The lookup contains &lt;STRONG&gt;thousands of rows.&amp;nbsp;&lt;/STRONG&gt;We want to delete rows from this lookup which are older than 7 days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To give an idea this is how the lookup looks like except that it contains thousands of rows.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;my_date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;age&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Sep-1-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Rupert&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-31-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Sam&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-30-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Tony&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-29-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Prince&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;27&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-28-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Tom&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;24&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-27-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Sean&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Aug-26-2020&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Roger&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;21&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We keep on appending new data to this lookup on a daily basis but we don't really care about data which are 7 days old and hence want to remove those rows.&lt;/P&gt;&lt;P&gt;How do I do remove the rows efficiently from this KV store based lookup. I know the classic way to do this would be to search for rows that are newer than 7 days and output the results to the same lookup. Something like,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;inputlookup my_lookup | where date &amp;gt; now()-7 days | outputlookup my_lookup&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But given that the lookup contains tons of rows, I would like to do this efficiently and remove just the old rows instead of writing the entire result set again.&lt;/P&gt;&lt;P&gt;This should be possible with KV store but I am unable to figure out how.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 09:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-efficiently-delete-rows-from-KV-Store-based-lookup/m-p/517199#M145409</guid>
      <dc:creator>iet_ashish</dc:creator>
      <dc:date>2020-09-01T09:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently delete rows from KV Store based lookup.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-efficiently-delete-rows-from-KV-Store-based-lookup/m-p/517204#M145410</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/58367"&gt;@iet_ashish&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Besides the input-/outputlookup I am only aware of using REST. Check&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Archive/Deleting-Data-from-KV-Store/td-p/483037" target="_self"&gt;this thread&lt;/A&gt;&amp;nbsp;for a solution.&lt;BR /&gt;You could run it as a cron maybe.&lt;BR /&gt;&lt;BR /&gt;In the example they use &lt;EM&gt;LastUpdateTime&lt;/EM&gt; with an exact epoch timestamp. I am not sure if you can use something like -7d.&lt;BR /&gt;&lt;BR /&gt;If you have to give a unix timestamp, you could calculate it on the CLI and call the command in the crontable with a variable for the timestamp.&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 10:12:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-efficiently-delete-rows-from-KV-Store-based-lookup/m-p/517204#M145410</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2020-09-01T10:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently delete rows from KV Store based lookup.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-efficiently-delete-rows-from-KV-Store-based-lookup/m-p/517390#M145487</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/64317"&gt;@rnowitzki&lt;/a&gt;&amp;nbsp; for replying.&lt;/P&gt;&lt;P&gt;Is there anything apart from REST API to delete rows from KV store. I was looking for an approach where SPL could be leveraged.&lt;/P&gt;&lt;P&gt;Also, you are right about the -7d thing. I used it just to get my point across. In practice, I would have to use epoch time.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 06:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-efficiently-delete-rows-from-KV-Store-based-lookup/m-p/517390#M145487</guid>
      <dc:creator>iet_ashish</dc:creator>
      <dc:date>2020-09-02T06:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently delete rows from KV Store based lookup.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-efficiently-delete-rows-from-KV-Store-based-lookup/m-p/517417#M145496</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/58367"&gt;@iet_ashish&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;You might want to try the &lt;EM&gt;rest&lt;/EM&gt; command. I never used it, but if you can call the uri&amp;nbsp; that deletes the rows with the command, you could stay in the SPL world.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/SearchReference/Rest" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.5/SearchReference/Rest&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Let us know if it works.&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 07:47:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-efficiently-delete-rows-from-KV-Store-based-lookup/m-p/517417#M145496</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2020-09-02T07:47:34Z</dc:date>
    </item>
  </channel>
</rss>

