<?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: search event base on given time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291769#M88129</link>
    <description>&lt;P&gt;Found the problem. my lookup table define the time format as&lt;/P&gt;

&lt;P&gt;%d/%m/%y %H:%M&lt;BR /&gt;
but when I open the .csv file from excel it auto changed the time format to&lt;/P&gt;

&lt;P&gt;%d/%m/%Y %H:%M&lt;BR /&gt;
so the lookup table doesn't work. once I edit it in the notepad and change from 2017 to 17 and recreate the lookup table everything work as expected.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Nov 2017 23:48:53 GMT</pubDate>
    <dc:creator>samlinsongguo</dc:creator>
    <dc:date>2017-11-23T23:48:53Z</dc:date>
    <item>
      <title>search event base on given time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291765#M88125</link>
      <description>&lt;P&gt;I have two information door swipe card record and user logon record&lt;BR /&gt;
door swipe card record&lt;BR /&gt;
user swipetime result&lt;BR /&gt;
user1 21/11/17 8:39AM success&lt;BR /&gt;
user2 21/11/17 7:39AM success&lt;BR /&gt;
user3 21/11/17 8:30AM success&lt;BR /&gt;
user1 20/11/17 9:50AM success&lt;/P&gt;

&lt;P&gt;user logon record&lt;BR /&gt;
user logontime &lt;BR /&gt;
user1 21/11/17 8:42AM&lt;BR /&gt;
user2 21/11/17 7:45AM&lt;BR /&gt;
user1 20/11/17 3:25AM&lt;/P&gt;

&lt;P&gt;what I want to do is when I see a user logon event I can go search user swipe card record to see whether there is a swipe card event happened within 10 mins before.&lt;/P&gt;

&lt;P&gt;for example user1 logoned on at 21/11/17 8:42 so I want to check between 21/11/17 8:32AM and 21/11/17 8:42AM whether there is swipe card record, the return result will be success&lt;BR /&gt;
another case is user logoned on at 20/11/17 3:25AM so I want to check between 20/11/17 3:15AM and 20/11/17 3:25AM whether there is swipe card record, the return result will be nothing because there is no record.&lt;/P&gt;

&lt;P&gt;Anyone can give me some suggestion how should I write this?&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 03:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291765#M88125</guid>
      <dc:creator>samlinsongguo</dc:creator>
      <dc:date>2017-11-21T03:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: search event base on given time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291766#M88126</link>
      <description>&lt;P&gt;Make 「door swipe card record」 lookup and use time-based lookup.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.0/Knowledge/Defineatime-basedlookupinSplunkWeb"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.0/Knowledge/Defineatime-basedlookupinSplunkWeb&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Name of time field：swipetime &lt;BR /&gt;
Maximum offset：600&lt;/P&gt;

&lt;P&gt;The point of note is that time logontime  must be _time.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 06:42:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291766#M88126</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2017-11-21T06:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: search event base on given time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291767#M88127</link>
      <description>&lt;P&gt;Hi Hiroshisatoh&lt;BR /&gt;
Thank you for your suggestion. &lt;BR /&gt;
just a question on how to user the time-based lookup&lt;BR /&gt;
in the transforms.conf I have following config&lt;BR /&gt;
    [swipeR.csv]&lt;BR /&gt;
    batch_index_query = 0&lt;BR /&gt;
    case_sensitive_match = 0&lt;BR /&gt;
    filename = swipeR.csv&lt;BR /&gt;
    max_offset_secs = 600&lt;BR /&gt;
    time_field = SwipeTime&lt;BR /&gt;
    time_format = %d/%m/%y %H:%M&lt;BR /&gt;
however when I try to run following queue&lt;BR /&gt;
    index=main sourcetype="csv" &lt;BR /&gt;
    |lookup swipeR.csv  SwipeTime AS LogonAt OUTPUT Action&lt;BR /&gt;
it shows me error message&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Error in 'lookup' command: You cannot use timefield as a lookup field.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;any suggestion on what is may go wrong?&lt;BR /&gt;
Thanks&lt;BR /&gt;
Sam&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291767#M88127</guid>
      <dc:creator>samlinsongguo</dc:creator>
      <dc:date>2020-09-29T16:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: search event base on given time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291768#M88128</link>
      <description>&lt;P&gt;I think it may because I use the time as a lookup field &lt;BR /&gt;
I change my queue to &lt;BR /&gt;
    index=main sourcetype="csv" &lt;BR /&gt;
    | lookup swipe FullUserName OUTPUT Action&lt;BR /&gt;
it doesnt return any result, eventhough I am sure there is time match my queue. What is the syntax to use time based lookup? is that different as normal lookup?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 05:16:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291768#M88128</guid>
      <dc:creator>samlinsongguo</dc:creator>
      <dc:date>2017-11-22T05:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: search event base on given time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291769#M88129</link>
      <description>&lt;P&gt;Found the problem. my lookup table define the time format as&lt;/P&gt;

&lt;P&gt;%d/%m/%y %H:%M&lt;BR /&gt;
but when I open the .csv file from excel it auto changed the time format to&lt;/P&gt;

&lt;P&gt;%d/%m/%Y %H:%M&lt;BR /&gt;
so the lookup table doesn't work. once I edit it in the notepad and change from 2017 to 17 and recreate the lookup table everything work as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 23:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291769#M88129</guid>
      <dc:creator>samlinsongguo</dc:creator>
      <dc:date>2017-11-23T23:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: search event base on given time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291770#M88130</link>
      <description>&lt;P&gt;Hi HiroshiSatoh&lt;BR /&gt;
Your direction certain give me the right direction. but I still have some quetions on how to use time based lookup. &lt;BR /&gt;
in your answer you mentioned "The point of note is that time logontime must be _time." is that means the time to match is only works for default timestemp field _time and I cant make a different field? are you able to have a look another question i have relate with this exercise &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/594399/troubleshooting-timebased-lookup-table.html"&gt;https://answers.splunk.com/answers/594399/troubleshooting-timebased-lookup-table.html&lt;/A&gt;&lt;BR /&gt;
Thank you for your help&lt;BR /&gt;
Sam&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 01:23:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-event-base-on-given-time/m-p/291770#M88130</guid>
      <dc:creator>samlinsongguo</dc:creator>
      <dc:date>2017-11-28T01:23:35Z</dc:date>
    </item>
  </channel>
</rss>

