<?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 are compare time in lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677922#M231827</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much again for your quick reply. I tried with that before not working, all duplicate&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;account_id&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;group together within one event. For Example, we should have &lt;STRONG&gt;three separate&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;events for&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;account_id 121&lt;/STRONG&gt;. But when I use &lt;STRONG&gt;|where updatedate &amp;gt;comparedate or |search updatedate &amp;gt;comparedate Name=*&lt;/STRONG&gt;; those group together in one event. I couldn't remove that or separate them. Is there any way we can do that. Thank you again.&lt;/P&gt;</description>
    <pubDate>Sat, 17 Feb 2024 17:58:33 GMT</pubDate>
    <dc:creator>SplunkDash</dc:creator>
    <dc:date>2024-02-17T17:58:33Z</dc:date>
    <item>
      <title>How to compare time in lookup.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677879#M231806</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a lookup table called account_audit.csv and have a timestamp field UPDATE_DATE=01/05/24 04:49:26. How can I find all events within that lookup with UPDATE_DATE&amp;nbsp; &amp;gt;= 01/25/24. Any recommendations will be highly appreciated. Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 05:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677879#M231806</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2024-02-17T05:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare time in lookup.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677882#M231807</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234909"&gt;@SplunkDash&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at first, why are you using a lookup is you must use a timestamp?&lt;/P&gt;&lt;P&gt;a lookup is a static table. if you need to associate a timestamp to each row, it's easier to store these csv data in an index.&lt;/P&gt;&lt;P&gt;Anyway, you can also create a time based lookup, but I never used this option because, in this situation, I prefer to use the previous solution.&lt;/P&gt;&lt;P&gt;At least, directly answering to your question, you should transform the timestamp fields in epochtime, using "eval strptime", to elaborate the timestamp and compare with a time picker.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 05:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677882#M231807</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-02-17T05:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare time in lookup.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677888#M231813</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much for your quick response. Here what I did.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup account_audit.csv

| eval t=strftime(relative_time(now(),"-30d"), "%m/%d/%y" %H:%M:%S)

|eval updatedate=strptime(UPDATE_DATE, "%m/%d/%y" %H:%M:%S)

|eval comparetdate =strtime(t, "%m/%d/%y" %H:%M:%S)

|where updatedate &amp;gt;comparedate

|table account_id    Name   Org_Code    UPDATE_DATE&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;But I am not getting result as expected. It's coming like as follow (duplicate account id comes under same event as a group)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;account_id&amp;nbsp; &amp;nbsp; Name&amp;nbsp; &amp;nbsp;Org_Code&amp;nbsp; &amp;nbsp; UPDATE_DATE&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;121&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test&amp;nbsp; &amp;nbsp; &amp;nbsp; Y&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01/24/2024 04:52:10&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;121&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;121&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;123&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test2&amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/30/2024&amp;nbsp; 12:50:10&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;123&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;126&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;test3&amp;nbsp; &amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 02/01/2024&amp;nbsp; &amp;nbsp; 11:12:02&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;126&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Total events :3&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;How can I remove duplicate account Id, I tried with dedup, but not working.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 13:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677888#M231813</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2024-02-17T13:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare time in lookup.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677914#M231823</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234909"&gt;@SplunkDash&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;to remove the empty rows you sould use a command "Name=*"&lt;/P&gt;&lt;P&gt;Anyway, I'd use a simpler search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup account_audit.csv
| eval 
   updatedate=strptime(UPDATE_DATE, "%m/%d/%y" %H:%M:%S),
   comparetdate=now()-86400*30
| search updatedate&amp;gt;comparedate Name=*
| table account_id Name Org_Code UPDATE_DATE&lt;/LI-CODE&gt;&lt;P&gt;Even if, I'd use an index and not a lookup.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 16:09:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677914#M231823</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-02-17T16:09:41Z</dc:date>
    </item>
    <item>
      <title>How are compare time in lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677922#M231827</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much again for your quick reply. I tried with that before not working, all duplicate&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;account_id&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;group together within one event. For Example, we should have &lt;STRONG&gt;three separate&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;events for&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;account_id 121&lt;/STRONG&gt;. But when I use &lt;STRONG&gt;|where updatedate &amp;gt;comparedate or |search updatedate &amp;gt;comparedate Name=*&lt;/STRONG&gt;; those group together in one event. I couldn't remove that or separate them. Is there any way we can do that. Thank you again.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 17:58:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677922#M231827</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2024-02-17T17:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: How are compare time in lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677934#M231836</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234909"&gt;@SplunkDash&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&amp;nbsp;do you have in each event the four fields :&amp;nbsp;&lt;SPAN&gt;account_id, Name, Org_Code, UPDATE_DATE?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;because it shouldn't be possible that some fields aren't visualizes unless they are missing in the lookup.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this case, to assign the values where missing you coud use the join (even if I hate this command!), is this your requirement, put in the empty cells the values from other rows?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 06:30:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677934#M231836</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-02-18T06:30:53Z</dc:date>
    </item>
    <item>
      <title>How are compare time in lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677946#M231841</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you so much for your response truly appreciate it.&lt;/P&gt;&lt;P&gt;It's a pretty interesting issue. When I use [without condition] :&lt;/P&gt;&lt;P&gt;| inputlookup account_audit.csv&lt;BR /&gt;| eval&lt;BR /&gt;updatedate=strptime(UPDATE_DATE, "%m/%d/%y" %H:%M:%S),&lt;BR /&gt;comparetdate=now()-86400*30&lt;BR /&gt;| table account_id Name Org_Code UPDATE_DATE&lt;/P&gt;&lt;P&gt;getting (7 independent events)&lt;/P&gt;&lt;P&gt;121 test Y 01/24/2024 04:52:10&lt;/P&gt;&lt;P&gt;121&amp;nbsp;test Y 01/24/2024 04:52:12&lt;/P&gt;&lt;P&gt;121&amp;nbsp;test Y 01/24/2024 04:52:11&lt;/P&gt;&lt;P&gt;123 test2 A 01/30/2024 12:50:11&lt;/P&gt;&lt;P&gt;123&amp;nbsp;test2 A 01/30/2024 12:50:20&lt;/P&gt;&lt;P&gt;126 test3 B 02/01/2024 11:12:23&lt;/P&gt;&lt;P&gt;126&amp;nbsp;test3 B 02/01/2024 11:12:21&lt;/P&gt;&lt;P&gt;But when I use (with condition)&lt;/P&gt;&lt;P&gt;| inputlookup account_audit.csv&lt;BR /&gt;| eval&lt;BR /&gt;updatedate=strptime(UPDATE_DATE, "%m/%d/%y" %H:%M:%S),&lt;BR /&gt;comparetdate=now()-86400*30&lt;BR /&gt;| search updatedate&amp;gt;comparedate Name=*&lt;BR /&gt;| table account_id Name Org_Code UPDATE_DATE&lt;/P&gt;&lt;P&gt;getting (3 events and each event separated by dotted line for clear understanding)&lt;/P&gt;&lt;P&gt;121 test Y 01/24/2024 04:52:10&lt;/P&gt;&lt;P&gt;121&lt;/P&gt;&lt;P&gt;121&lt;/P&gt;&lt;P&gt;---------------------&lt;/P&gt;&lt;P&gt;123 test2 A 01/30/2024 12:50:10&lt;/P&gt;&lt;P&gt;123&lt;/P&gt;&lt;P&gt;------------&lt;/P&gt;&lt;P&gt;126 test3 B 02/01/2024 11:12:02&lt;/P&gt;&lt;P&gt;126&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 16:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-time-in-lookup/m-p/677946#M231841</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2024-02-18T16:05:43Z</dc:date>
    </item>
  </channel>
</rss>

