<?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 to compare a field value that contains date only to today's date? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compare-a-field-value-that-contains-date-only-to-today-s/m-p/287363#M18194</link>
    <description>&lt;P&gt;I have looked at all of the date comparison questions/answers but cannot find an answer to this question. I have a field (&lt;STRONG&gt;StandInDay&lt;/STRONG&gt;) which contains only the date, no time (StandInDay=2016-12-01). In my dashboard, I want a panel that displays the number of transactions in which this &lt;STRONG&gt;StandInDay&lt;/STRONG&gt; value matches today's date (among other criteria). So basically, the number of these transactions in which the &lt;STRONG&gt;StandInDay&lt;/STRONG&gt; is equal to today, but I cannot seem to get it to work. I have tried converting to epoch and comparing to now() but that doesn't work. Any suggestions?&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2016 23:05:16 GMT</pubDate>
    <dc:creator>maurkb</dc:creator>
    <dc:date>2016-12-22T23:05:16Z</dc:date>
    <item>
      <title>How to compare a field value that contains date only to today's date?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compare-a-field-value-that-contains-date-only-to-today-s/m-p/287363#M18194</link>
      <description>&lt;P&gt;I have looked at all of the date comparison questions/answers but cannot find an answer to this question. I have a field (&lt;STRONG&gt;StandInDay&lt;/STRONG&gt;) which contains only the date, no time (StandInDay=2016-12-01). In my dashboard, I want a panel that displays the number of transactions in which this &lt;STRONG&gt;StandInDay&lt;/STRONG&gt; value matches today's date (among other criteria). So basically, the number of these transactions in which the &lt;STRONG&gt;StandInDay&lt;/STRONG&gt; is equal to today, but I cannot seem to get it to work. I have tried converting to epoch and comparing to now() but that doesn't work. Any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 23:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compare-a-field-value-that-contains-date-only-to-today-s/m-p/287363#M18194</guid>
      <dc:creator>maurkb</dc:creator>
      <dc:date>2016-12-22T23:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare a field value that contains date only to today's date?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compare-a-field-value-that-contains-date-only-to-today-s/m-p/287364#M18195</link>
      <description>&lt;P&gt;Today's date is not a single epoch time value, but a range of values, so comparing to now() - which is the precise start time of the search - isn't going to work.&lt;/P&gt;

&lt;P&gt;The easiest way to do this is to convert now() to a text field in the same format as StandInDay, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| eval today=strftime(now(),"%Y-%m-%d")
| where StandInDay=today
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should do the trick.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 06:16:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compare-a-field-value-that-contains-date-only-to-today-s/m-p/287364#M18195</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-12-23T06:16:18Z</dc:date>
    </item>
  </channel>
</rss>

