<?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 Compare two date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42090#M179022</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'd like to compare two date with this format 2011-11-30 22:21:05 for example.&lt;BR /&gt;
If I search the following, this didn't work.&lt;BR /&gt;
index="toto" solvedate&amp;gt;due_date&lt;/P&gt;

&lt;P&gt;but if I search with this it work:&lt;BR /&gt;
index="toto" solvedate&amp;gt;2011-12-15 17:21:05&lt;/P&gt;

&lt;P&gt;What must I do for this to work ?&lt;BR /&gt;
The date are correctly stored in the field.&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Thu, 29 Dec 2011 15:55:20 GMT</pubDate>
    <dc:creator>stevesomone</dc:creator>
    <dc:date>2011-12-29T15:55:20Z</dc:date>
    <item>
      <title>Compare two date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42090#M179022</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'd like to compare two date with this format 2011-11-30 22:21:05 for example.&lt;BR /&gt;
If I search the following, this didn't work.&lt;BR /&gt;
index="toto" solvedate&amp;gt;due_date&lt;/P&gt;

&lt;P&gt;but if I search with this it work:&lt;BR /&gt;
index="toto" solvedate&amp;gt;2011-12-15 17:21:05&lt;/P&gt;

&lt;P&gt;What must I do for this to work ?&lt;BR /&gt;
The date are correctly stored in the field.&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 15:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42090#M179022</guid>
      <dc:creator>stevesomone</dc:creator>
      <dc:date>2011-12-29T15:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42091#M179023</link>
      <description>&lt;P&gt;You can convert the fields to epoch values and compare that way for best results... look to use the strptime() function... ie:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval compare=strptime(solvedate,"%Y-%m-%d %H:%M:%S") | where compare&amp;gt;strptime(due_date,"%Y-%m-%d %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Dec 2011 16:14:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42091#M179023</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2011-12-29T16:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42092#M179024</link>
      <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;

&lt;P&gt;This work great.&lt;/P&gt;

&lt;P&gt;Can we find all the function in the wiki ? Or somewhere else ?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 16:17:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42092#M179024</guid>
      <dc:creator>stevesomone</dc:creator>
      <dc:date>2011-12-29T16:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42093#M179025</link>
      <description>&lt;P&gt;Command reference can be found here:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/ListOfSearchCommands"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/ListOfSearchCommands&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Functions for eval and where are here:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Remember to vote the answer as correct, dont want to leave things lingering as unanswered &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 16:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42093#M179025</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2011-12-29T16:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42094#M179026</link>
      <description>&lt;P&gt;Hi , &lt;BR /&gt;
source="dbmon-tail://idwarehouse/idw_account" application=TFAYD  [|inputlookup execSSO.csv |rename sso as owner] |eval exp_date=strftime(relative_time(strptime(lastPasswordChange,"%Y-%m-%d %H:%M:%S"),"+90d"), "%Y-%m-%d %H:%M")  |eval compare=strptime(exp_date,"%Y-%m-%d %H:%M:%S") | where compare&amp;gt;now()&lt;/P&gt;

&lt;P&gt;output,&lt;/P&gt;

&lt;P&gt;exp_date =2014-11-04 11:06&lt;/P&gt;

&lt;P&gt;I am not getting the compare&amp;gt;now()  output .&lt;/P&gt;

&lt;P&gt;exp_date-currentdate(now()) = number of days output .... ????? i am not getting the output ..&lt;/P&gt;

&lt;P&gt;Thank u ...&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Siraj&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:49:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-date/m-p/42094#M179026</guid>
      <dc:creator>siraj198204</dc:creator>
      <dc:date>2020-09-28T17:49:46Z</dc:date>
    </item>
  </channel>
</rss>

