<?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: How to compare using eval expression and field value pair in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261034#M176374</link>
    <description>&lt;P&gt;It worked the way i wanted.. Thank you so much..&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2016 11:00:38 GMT</pubDate>
    <dc:creator>k_harini</dc:creator>
    <dc:date>2016-10-20T11:00:38Z</dc:date>
    <item>
      <title>How to compare using eval expression and field value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261028#M176368</link>
      <description>&lt;P&gt;I want the table to be generated based on 2 conditions - one condition is comparing eval expression and other field value pair.. how to do that&lt;BR /&gt;
index="myindex" |eval Due_Date_Time = strftime(strptime('Due By',"%d.%m.%Y"),"%d.%m.%Y")|eval now_time=strftime(now(),"%d.%m.%Y")|table ID,Category | where (now_time&amp;gt;=Due_Date_Time) AND ('System Status'!="Completed") &lt;/P&gt;

&lt;P&gt;This where clause is not working.. please help&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:28:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261028#M176368</guid>
      <dc:creator>k_harini</dc:creator>
      <dc:date>2020-09-29T11:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare using eval expression and field value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261029#M176369</link>
      <description>&lt;P&gt;i dont have logs to test this, can you check this once - &lt;BR /&gt;
    &lt;PRE&gt;index="myindex" |eval Due_Date_Time = strftime(strptime('Due By',"%d.%m.%Y"),"%d.%m.%Y")|eval now_time=strftime(now(),"%d.%m.%Y")|table ID,Category | where (now_time&amp;gt;=Due_Date_Time) | search 'System Status'!="Completed"&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;or even, you can try checking the System Status at first stage itself - &lt;BR /&gt;
&lt;PRE&gt;index="myindex" 'System Status'!="Completed" |eval Due_Date_Time = strftime(strptime('Due By',"%d.%m.%Y"),"%d.%m.%Y")|eval now_time=strftime(now(),"%d.%m.%Y")|table ID,Category | where (now_time&amp;gt;=Due_Date_Time) &lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261029#M176369</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-09-29T11:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare using eval expression and field value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261030#M176370</link>
      <description>&lt;P&gt;Thanks for your reply.. both are not working&lt;/P&gt;

&lt;P&gt;second one works till here.. where clause time condition not working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
index="myindex" "System Status"!="Completed"|eval Due_Date_Time = strftime(strptime('Due By',"%d.%m.%Y"),"%d.%m.%Y")|eval now_time=strftime(now(),"%d.%m.%Y")|table ID,Category&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:28:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261030#M176370</guid>
      <dc:creator>k_harini</dc:creator>
      <dc:date>2020-09-29T11:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare using eval expression and field value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261031#M176371</link>
      <description>&lt;P&gt;I can see two issues:&lt;/P&gt;

&lt;P&gt;1) Your "|table ID,Category" is getting rid of some fields you are using later on such as now_time, System Status or Due_Date_Time. &lt;BR /&gt;
2) I think this part is also going to cause you a headache as you are not comparing integers with integers, just strings with strings:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; where (now_time&amp;gt;=Due_Date_Time)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you try this instead?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex" 
|eval Due_Date_Epoch = strptime('Due By',"%d.%m.%Y")
|table ID, Category, Due_Date_Epoch, 'System Status'
| where (now() &amp;gt;= Due_Date_Epoch) AND ('System Status'!="Completed")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
J&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:30:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261031#M176371</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2020-09-29T11:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare using eval expression and field value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261032#M176372</link>
      <description>&lt;P&gt;Thanks for your reply. This is also not working..&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 10:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261032#M176372</guid>
      <dc:creator>k_harini</dc:creator>
      <dc:date>2016-10-20T10:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare using eval expression and field value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261033#M176373</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; index="myindex" 'System Status'!="Completed"
  |eval Due_Date = strptime('Due By',"%d.%m.%Y") 
  | where (now() &amp;gt;= Due_Date)
  |table ID, Category
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Oct 2016 10:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261033#M176373</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-10-20T10:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare using eval expression and field value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261034#M176374</link>
      <description>&lt;P&gt;It worked the way i wanted.. Thank you so much..&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 11:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-using-eval-expression-and-field-value-pair/m-p/261034#M176374</guid>
      <dc:creator>k_harini</dc:creator>
      <dc:date>2016-10-20T11:00:38Z</dc:date>
    </item>
  </channel>
</rss>

