<?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: When I Compare a field that has dates, the results brings dates out of the comparison in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289711#M87647</link>
    <description>&lt;P&gt;In the strptime for &lt;CODE&gt;lDoS Date&lt;/CODE&gt;, @DalJeanis's answer has single quotes (very important), your screenshots have double quotes, causing it to fail. Change it to single quotes.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jul 2017 21:55:15 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-07-05T21:55:15Z</dc:date>
    <item>
      <title>When I Compare a field that has dates, the results brings dates out of the comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289707#M87643</link>
      <description>&lt;P&gt;I'm trying to filter a field when date is greater than 07/05/2017&lt;/P&gt;

&lt;P&gt;The date fild format is as follows : DD-MMM-YY Ex. 30-SEP-17&lt;/P&gt;

&lt;P&gt;My search &lt;/P&gt;

&lt;P&gt;index="eolr" sourcetype="FinDeVida.csv" "LDoS Date"&amp;gt;"05-JUL-17" AND Slot=Chassis | stats count by "SNMP Name" "LDoS Date"&lt;/P&gt;

&lt;P&gt;Brings dates from 2013  or 2012&lt;/P&gt;

&lt;P&gt;Ex.&lt;BR /&gt;
SNMP Name   LDoS Date   count&lt;BR /&gt;
cisco12410xr          31-JAN-13 5&lt;BR /&gt;
cisco2611XM       31-MAR-12 13&lt;/P&gt;

&lt;P&gt;The less-equal  does not bring any result as well as the graeater-equal even there are dates matching the criteria.&lt;/P&gt;

&lt;P&gt;Any insight is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 17:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289707#M87643</guid>
      <dc:creator>asotorod</dc:creator>
      <dc:date>2017-07-05T17:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: When I Compare a field that has dates, the results brings dates out of the comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289708#M87644</link>
      <description>&lt;P&gt;So, if you want to compare dates, you have to make them comparable.  That means use &lt;CODE&gt;strptime&lt;/CODE&gt; to pull it into epoch time, and compare using epoch time, and/or (optionally) use &lt;CODE&gt;strftime&lt;/CODE&gt; to put it into a format that can be directly compared. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="eolr" sourcetype="FinDeVida.csv"  Slot=Chassis 
| eval myLDoSdate = strptime('LDoS Date',"%d-%b-%y")
| search myLDoSdate &amp;gt; strptime("05-Jul-17","%d-%b-%y")
| eval myLDoSdate = strftime(myLDoSdate,"%Y-%m-%d")
| stats count by "SNMP Name" myLDoSdate
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;Updated to put 'LDoS Date' in single quotes instead of double quotes.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 19:27:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289708#M87644</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-05T19:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: When I Compare a field that has dates, the results brings dates out of the comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289709#M87645</link>
      <description>&lt;P&gt;Dates and times cannot be compared as strings.  They should be converted into epoch form for comparison.  Try this query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="eolr" sourcetype="FinDeVida.csv" "LDoS Date"=* AND Slot=Chassis | eval eLDosDate=strptime('LDos Date', "%d-%b-%y") | eval minDate=strptime("05-JUL-17", "%d-%b-%y") | where eLDosDate &amp;gt; minDate | stats count by "SNMP Name" "LDoS Date"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Jul 2017 19:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289709#M87645</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-07-05T19:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: When I Compare a field that has dates, the results brings dates out of the comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289710#M87646</link>
      <description>&lt;P&gt;Thank you Dal, for your answer, I tried the searches you set in different ways but no results at all. I add the images.alt text&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 20:35:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289710#M87646</guid>
      <dc:creator>asotorod</dc:creator>
      <dc:date>2017-07-05T20:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: When I Compare a field that has dates, the results brings dates out of the comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289711#M87647</link>
      <description>&lt;P&gt;In the strptime for &lt;CODE&gt;lDoS Date&lt;/CODE&gt;, @DalJeanis's answer has single quotes (very important), your screenshots have double quotes, causing it to fail. Change it to single quotes.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 21:55:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289711#M87647</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-05T21:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: When I Compare a field that has dates, the results brings dates out of the comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289712#M87648</link>
      <description>&lt;P&gt;Great it worked smooth, I Just made two adjustments in syntax&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="eolr" sourcetype="FinDeVida.csv" "LDoS Date"="*" AND Slot=Chassis | eval eLDosDate=strptime('LDoS Date', "%d-%b-%y") | eval minDate=strptime("05-JUL-17", "%d-%b-%y") | where eLDosDate &amp;gt; minDate | stats count by "SNMP Name" "LDoS Date"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;"LDoS Date"="*"  and strptime('LDoS Date'&lt;/P&gt;

&lt;P&gt;Thank you very much for yor quick and prompt answer.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 23:22:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289712#M87648</guid>
      <dc:creator>asotorod</dc:creator>
      <dc:date>2017-07-05T23:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: When I Compare a field that has dates, the results brings dates out of the comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289713#M87649</link>
      <description>&lt;P&gt;@asotorod - If the answer provided by richgalloway provided a working solution to your question, please don't forget to resolve this post by clicking "Accept". Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 23:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-I-Compare-a-field-that-has-dates-the-results-brings-dates/m-p/289713#M87649</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-07-05T23:40:16Z</dc:date>
    </item>
  </channel>
</rss>

