<?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 Filtering results from inputlookup by date/time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-results-from-inputlookup-by-date-time/m-p/151567#M30839</link>
    <description>&lt;P&gt;I have searched for hours on this and can't seem to find a way to do it.  I have a .csv file being read in with inputlookup and the first column is _time... I want to be able to run a query that includes grabbing the file with inputlookup and then filtering the results based on a specific date range.  I have tried piping earliest/latest afterwards, using gentimes, making the inputlookup into a subsearch and trying to do the earliest/latest search beforehand... alas, I keep coming up short.  The closest I can get is the solution found here:  &lt;A href="http://answers.splunk.com/answers/11194/time-based-inputookup?sort=oldest"&gt;http://answers.splunk.com/answers/11194/time-based-inputookup?sort=oldest&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But I dont want to have to write the query using unix timestamp defined date rangees (ie. now() -9000) but instead using dates.&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated.  Thanks.&lt;BR /&gt;
Eric&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2014 17:42:53 GMT</pubDate>
    <dc:creator>EricLloyd79</dc:creator>
    <dc:date>2014-02-14T17:42:53Z</dc:date>
    <item>
      <title>Filtering results from inputlookup by date/time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-results-from-inputlookup-by-date-time/m-p/151567#M30839</link>
      <description>&lt;P&gt;I have searched for hours on this and can't seem to find a way to do it.  I have a .csv file being read in with inputlookup and the first column is _time... I want to be able to run a query that includes grabbing the file with inputlookup and then filtering the results based on a specific date range.  I have tried piping earliest/latest afterwards, using gentimes, making the inputlookup into a subsearch and trying to do the earliest/latest search beforehand... alas, I keep coming up short.  The closest I can get is the solution found here:  &lt;A href="http://answers.splunk.com/answers/11194/time-based-inputookup?sort=oldest"&gt;http://answers.splunk.com/answers/11194/time-based-inputookup?sort=oldest&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But I dont want to have to write the query using unix timestamp defined date rangees (ie. now() -9000) but instead using dates.&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated.  Thanks.&lt;BR /&gt;
Eric&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 17:42:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-results-from-inputlookup-by-date-time/m-p/151567#M30839</guid>
      <dc:creator>EricLloyd79</dc:creator>
      <dc:date>2014-02-14T17:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering results from inputlookup by date/time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-results-from-inputlookup-by-date-time/m-p/151568#M30840</link>
      <description>&lt;P&gt;did you attempt to do a strptime on the field |inputlookup myFile.csv | eval mytime=strptime(_time,formatoftime)&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/Commontimeformatvariables"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This way you can then use "mytime" as regular date/times.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 17:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-results-from-inputlookup-by-date-time/m-p/151568#M30840</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2014-02-14T17:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering results from inputlookup by date/time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-results-from-inputlookup-by-date-time/m-p/151569#M30841</link>
      <description>&lt;P&gt;I have thought about this and tried it but not the way you presented it.  Im pondering how to further filter the results with the new mytime variable.&lt;BR /&gt;&lt;BR /&gt;
| inputlookup indextest_sourcetype.csv | eval mytime=strptime(_time, "%m/%d/%Y") | where mytime ...  or can I add a search here?  My preference ultimately would be to be able to use the earliest/latest relational date pickers..  Ill keep experimenting&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:53:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-results-from-inputlookup-by-date-time/m-p/151569#M30841</guid>
      <dc:creator>EricLloyd79</dc:creator>
      <dc:date>2020-09-28T15:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering results from inputlookup by date/time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-results-from-inputlookup-by-date-time/m-p/151570#M30842</link>
      <description>&lt;P&gt;Thanks man, with your hint I was able to figure it out.  Its ugly but it works.  Any suggestion on how it could be improved would be welcomed.&lt;/P&gt;

&lt;P&gt;| inputlookup indextest_sourcetype.csv | eval early="2/10/2014" | eval late="2/12/2014" | eval myearlytime=strptime(early, "%m/%d/%Y") | eval mylatetime=strptime(late, "%m/%d/%Y")  | where _time &amp;gt;= myearlytime AND _time &amp;lt;= mylatetime&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 19:25:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-results-from-inputlookup-by-date-time/m-p/151570#M30842</guid>
      <dc:creator>EricLloyd79</dc:creator>
      <dc:date>2014-02-14T19:25:27Z</dc:date>
    </item>
  </channel>
</rss>

