<?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: kvstore, inputlookup and time-bounds in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326679#M2811</link>
    <description>&lt;P&gt;Why should you have to explicitly filter by time with a "search" or "where" command for a kvstore lookup when you don't have to with a regular search from an index?! This is a terrible approach. If it's the only approach to filtering a kvstore lookup by time then shame on Splunk.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Apr 2020 22:34:29 GMT</pubDate>
    <dc:creator>frechette</dc:creator>
    <dc:date>2020-04-30T22:34:29Z</dc:date>
    <item>
      <title>kvstore, inputlookup and time-bounds</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326675#M2807</link>
      <description>&lt;P&gt;I'm trying to set up a kvstore lookup where the results from inputlookup can be filtered using the regular time-pickers available on the web GUI or with the latest= and earliest= modifiers.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ collections.conf
[testkv]
enforceTypes = true
field.action = string
field.ts = time

$ transforms.conf
[testkv]
external_type = kvstore
fields_list =  action, ts
time_field = ts
;time_format = %s.%3N
;time_format = %s.%Q
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The ts field contains a UNIX epoch with milliseconds so 10+3 digits.&lt;/P&gt;

&lt;P&gt;Regardless what I select "Last 15 minutes", "Last 4 hours" I always get the whole kvstore content.&lt;/P&gt;

&lt;P&gt;First of all, is that doable in general and, if yes, any ideas on what's wrong? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 11:11:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326675#M2807</guid>
      <dc:creator>lfrit</dc:creator>
      <dc:date>2017-09-08T11:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: kvstore, inputlookup and time-bounds</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326676#M2808</link>
      <description>&lt;P&gt;Sure, but not in a normal way.  Do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| addinfo
| map
    [| inputlookup testkv
    | search ts&amp;gt;=$info_min_time$ AND ts&amp;lt;=$info_max_time$]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Sep 2017 15:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326676#M2808</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-09T15:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: kvstore, inputlookup and time-bounds</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326677#M2809</link>
      <description>&lt;P&gt;Many thanks! That's a really interesting approach &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I've just added a small workaround to handle the "All time" case and it seems to work as expected, I can simply create a dedicated macro now to make it more handy.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | makeresults
 | addinfo
 | eval info_max_time=if(info_max_time=="+Infinity", 9999999999999, info_max_time)
 | map
     [| inputlookup testkv
     | search ts&amp;gt;=$info_min_time$ AND ts&amp;lt;=$info_max_time$]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do you know any sort trick to cast that "+Infinity" so I can directly compare it with my ts field?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 09:38:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326677#M2809</guid>
      <dc:creator>lfrit</dc:creator>
      <dc:date>2017-09-11T09:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: kvstore, inputlookup and time-bounds</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326678#M2810</link>
      <description>&lt;P&gt;I should have caught that.  I would do it exactly as you have done&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 13:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326678#M2810</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-11T13:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: kvstore, inputlookup and time-bounds</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326679#M2811</link>
      <description>&lt;P&gt;Why should you have to explicitly filter by time with a "search" or "where" command for a kvstore lookup when you don't have to with a regular search from an index?! This is a terrible approach. If it's the only approach to filtering a kvstore lookup by time then shame on Splunk.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 22:34:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326679#M2811</guid>
      <dc:creator>frechette</dc:creator>
      <dc:date>2020-04-30T22:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: kvstore, inputlookup and time-bounds</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326680#M2812</link>
      <description>&lt;P&gt;You can also add the time filter into the &lt;CODE&gt;WHERE&lt;/CODE&gt; clause of &lt;CODE&gt;inputlookup&lt;/CODE&gt;, e.g.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| inputlookup testkv WHERE &lt;BR /&gt;
        [| makeresults count=1 &lt;BR /&gt;
        | addinfo &lt;BR /&gt;
        | eval info_max_time=if(info_max_time=="+Infinity", 2147483647, info_max_time) &lt;BR /&gt;
        | eval search="( (ts&amp;gt;=" . info_min_time . ") AND (" . "ts&amp;lt;" . info_max_time . ") )" &lt;BR /&gt;
        | table search ]&lt;/CODE&gt;    &lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 14:56:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/kvstore-inputlookup-and-time-bounds/m-p/326680#M2812</guid>
      <dc:creator>dnitschke_splun</dc:creator>
      <dc:date>2020-05-02T14:56:56Z</dc:date>
    </item>
  </channel>
</rss>

