<?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 Filter time-based values from inputlookup by time picker range in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/295996#M3736</link>
    <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;

&lt;P&gt;I have csv tables (inputlookup) with latest time of particular event for users, sources..., reflected in field &lt;CODE&gt;_time&lt;/CODE&gt; . These tables are utilized as  filters for my dashboard with statistics  (| inputlookup mylookup | fields user). This helps to decrease time of filtering for a long-time ranges for events in dashboard.&lt;/P&gt;

&lt;P&gt;Is it possible to filter out values from inputlookup table output with time range chosen in a Time picker?&lt;BR /&gt;
Something like | inputlookup mylookup | where _time&amp;gt;$timepicker.earliest$ AND _time&amp;lt;$timepicker.latest$| fields user&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2017 17:56:52 GMT</pubDate>
    <dc:creator>evelenke</dc:creator>
    <dc:date>2017-10-12T17:56:52Z</dc:date>
    <item>
      <title>Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/295996#M3736</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;

&lt;P&gt;I have csv tables (inputlookup) with latest time of particular event for users, sources..., reflected in field &lt;CODE&gt;_time&lt;/CODE&gt; . These tables are utilized as  filters for my dashboard with statistics  (| inputlookup mylookup | fields user). This helps to decrease time of filtering for a long-time ranges for events in dashboard.&lt;/P&gt;

&lt;P&gt;Is it possible to filter out values from inputlookup table output with time range chosen in a Time picker?&lt;BR /&gt;
Something like | inputlookup mylookup | where _time&amp;gt;$timepicker.earliest$ AND _time&amp;lt;$timepicker.latest$| fields user&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 17:56:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/295996#M3736</guid>
      <dc:creator>evelenke</dc:creator>
      <dc:date>2017-10-12T17:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/295997#M3737</link>
      <description>&lt;P&gt;@evelenke can you add the _time field values from your lookup file mylookup.csv? Your life would be easy if you store time in YYYY/MM/DD HH:MM:SS format.&lt;/P&gt;

&lt;P&gt;In order to pass time from Time Picker over to your inputlookup, you will require two things:&lt;/P&gt;

&lt;P&gt;1) Convert epoch time to string time in YYYY/MM/DD HH:MM:SS. Since csv file will have string time, ensure that this specific format is used to allow string time comparison (otherwise comparison will fail and you would need different approach to use epoch time instead).&lt;/P&gt;

&lt;P&gt;2) Since time picker may not always have epoch time, it rather has the relative time with snap to notation, hence you would need to deduce the string time for selected earliest and latest time through time input change event handler. Refer to one of my answers for how to do this: &lt;A href="https://answers.splunk.com/answers/578984/running-one-of-two-searches-based-on-time-picker-s.html?childToView=578991#answer-578991"&gt;https://answers.splunk.com/answers/578984/running-one-of-two-searches-based-on-time-picker-s.html?childToView=578991#answer-578991&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;3) You should be able to perform &lt;CODE&gt;where&lt;/CODE&gt; clause in the base inputlookup command itself, rather than a separate pipe (which may lead to poor query performance based on the size of lookup file).&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 18:42:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/295997#M3737</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-12T18:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/295998#M3738</link>
      <description>&lt;P&gt;I use the following, that works in any search and/or dashboard, report, alert, ...&lt;BR /&gt;
    | inputlookup mylookup.csv &lt;BR /&gt;
    | addinfo&lt;BR /&gt;
    | where _time&amp;gt;=info_min_time AND _time&amp;lt;=info_max_time&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/295998#M3738</guid>
      <dc:creator>peter_krammer</dc:creator>
      <dc:date>2020-09-29T19:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/295999#M3739</link>
      <description>&lt;P&gt;It works but not from a dashboard, using a shared timerange picker. Thanks for the idea anyway!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 08:37:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/295999#M3739</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2018-07-18T08:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296000#M3740</link>
      <description>&lt;P&gt;I correct! It works actually using info_min_time  and info_max_time  instead of $timeToken.earliest$ or &amp;gt;$timeToken.latest$&lt;/P&gt;

&lt;P&gt;Thanks a lot!!!&lt;BR /&gt;
Marco&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:28:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296000#M3740</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2020-09-29T20:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296001#M3741</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;how did you use your code in order to work?&lt;/P&gt;

&lt;P&gt;I´ve the following:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI&gt; &lt;/LI&gt;
&lt;LI&gt;   Time Range&lt;/LI&gt;
&lt;LI&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;     0&lt;/LI&gt;
&lt;LI&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;And then the query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      &amp;lt;query&amp;gt;| inputlookup append=t Product_Status.csv  where "Product Origin" = "*" | eval_time = strptime(OpenDate,"%d/%m/%Y")  | timechart span=1month count("Product Origin") as ProductOrigin&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$TimeRangePkr.earliest$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$TimeRangePkr.latest$&amp;lt;/latest&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How you used the " info_min_time and info_max_time instead of $timeToken.earliest$ or &amp;gt;$timeToken.latest$" ?&lt;/P&gt;

&lt;P&gt;Tks&lt;BR /&gt;
,,Hi Marco. How you use the code in order to work?&lt;/P&gt;

&lt;P&gt;I´ve a picker:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="time" token="time" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Time range&amp;lt;/label&amp;gt;
  &amp;lt;default&amp;gt;
    &amp;lt;earliest&amp;gt;-30d@d&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
  &amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and  a query that don´t work:&lt;/P&gt;

&lt;P&gt;| inputlookup append=t TestStatys.csv  where "Produt Origin" = "*" | eval_time = strptime(OpenDate,"%d/%m/%Y")  | timechart span=1month count("Product Origin") as Product&lt;BR /&gt;
          &lt;EARLIEST&gt;$time.earliest$&lt;/EARLIEST&gt;&lt;BR /&gt;
          &lt;LATEST&gt;$time.latest$&lt;/LATEST&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:30:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296001#M3741</guid>
      <dc:creator>dpataferreira</dc:creator>
      <dc:date>2020-09-29T20:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296002#M3742</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;query&amp;gt;
| inputlookup append=t Product_Status.csv  where "Product Origin" = "*" 
| eval _time = strptime(OpenDate,"%d/%m/%Y") 
| addinfo
| where _time&amp;gt;=info_min_time AND _time&amp;lt;=info_max_time
| timechart span=1month count("Product Origin") as ProductOrigin
&amp;lt;/query&amp;gt;
&amp;lt;earliest&amp;gt;$time.earliest$&amp;lt;/earliest&amp;gt;
&amp;lt;latest&amp;gt;$time.latest$&amp;lt;/latest&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2018 23:12:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296002#M3742</guid>
      <dc:creator>peter_krammer</dc:creator>
      <dc:date>2018-07-18T23:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296003#M3743</link>
      <description>&lt;P&gt;Exactly! I confirm that works also for me!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 05:25:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296003#M3743</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2018-07-19T05:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296004#M3744</link>
      <description>&lt;P&gt;@peter_krammer  Thanks bro, for me also it's works fine in a dashboard.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 17:05:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296004#M3744</guid>
      <dc:creator>james_n</dc:creator>
      <dc:date>2020-04-08T17:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296005#M3745</link>
      <description>&lt;P&gt;In case your lookup file contains time in seconds since the epoch, 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 Product_Status.csv 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="( (_time&amp;gt;=" . info_min_time . ") AND (" . "_time&amp;lt;" . info_max_time . ") )" &lt;BR /&gt;
        | table search ]&lt;/CODE&gt;    &lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 15:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/296005#M3745</guid>
      <dc:creator>dnitschke_splun</dc:creator>
      <dc:date>2020-05-02T15:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/544898#M3746</link>
      <description>&lt;P&gt;Does doing it this way make it more performant over the alternative to filter afterwards?&lt;/P&gt;&lt;P&gt;If yes, could you explain where the performance improvement comes from?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am always interested to learn performance tricks for Splunk.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 09:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/544898#M3746</guid>
      <dc:creator>peter_krammer</dc:creator>
      <dc:date>2021-03-23T09:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filter time-based values from inputlookup by time picker range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/544899#M3747</link>
      <description>&lt;P&gt;I now use an updated version, that also compensates for choosing "All Time" in the time picker, which makes info_max_time set to "+Infinity" which unfortunately is not a number.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup mylookup.csv
| addinfo 
| where _time&amp;gt;=info_min_time AND (_time&amp;lt;=info_max_time OR info_max_time="+Infinity")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Mar 2021 09:40:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Filter-time-based-values-from-inputlookup-by-time-picker-range/m-p/544899#M3747</guid>
      <dc:creator>peter_krammer</dc:creator>
      <dc:date>2021-03-23T09:40:28Z</dc:date>
    </item>
  </channel>
</rss>

