<?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: stats count by date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228600#M67621</link>
    <description>&lt;P&gt;It seems like there is a field called &lt;CODE&gt;date&lt;/CODE&gt; in your event.  The field that is used for &lt;CODE&gt;_time&lt;/CODE&gt; is not the &lt;CODE&gt;date&lt;/CODE&gt; field. &lt;/P&gt;</description>
    <pubDate>Tue, 04 Oct 2016 00:12:44 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-10-04T00:12:44Z</dc:date>
    <item>
      <title>stats count by date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228598#M67619</link>
      <description>&lt;P&gt;earliest=10/1/2016:00:00:00 latest=10/2/2016:23:59:59 sourcetype=iis | stats count by date&lt;/P&gt;

&lt;P&gt;date    count&lt;BR /&gt;
2016-10-01  500&lt;BR /&gt;
2016-10-02  707&lt;BR /&gt;
2016-10-03  205 &lt;/P&gt;

&lt;P&gt;earliest=10/1/2016:00:00:00 latest=10/2/2016:23:59:59 sourcetype=iis | eval date=strftime(_time, "%Y-%m-%d") | stats count by date&lt;/P&gt;

&lt;P&gt;date    count&lt;BR /&gt;
2016-10-01  705&lt;BR /&gt;
2016-10-02  707 &lt;/P&gt;

&lt;P&gt;Why does the first query return 3 rows, especially when 10/3/2016 is not a part of the search time range?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 23:58:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228598#M67619</guid>
      <dc:creator>nk-1</dc:creator>
      <dc:date>2016-10-03T23:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228599#M67620</link>
      <description>&lt;P&gt;Date isn't a default field in Splunk, so it's pretty much the big unknown here, what those values being logged by IIS actually are/mean. Who knows.   &lt;/P&gt;

&lt;P&gt;If you want to see a count for the last few days technically you want to be using &lt;CODE&gt;timechart&lt;/CODE&gt;.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=10/1/2016:00:00:00 latest=10/2/2016:23:59:59 sourcetype=iis | timechart span=1d count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Anyway, as to why there's a date value being returned that's outside of the timerange, my guess is that in those 205 events, for some semantic reason inside the events themselves, the "date" the event is talking about is actually in the (then) future. &lt;/P&gt;

&lt;P&gt;One way to find out more is to run this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=10/1/2016:00:00:00 latest=10/2/2016:23:59:59 sourcetype=iis | stats last(_raw) as rawtext count by date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it will grab a sample of the rawtext for each of your three rows. &lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 00:10:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228599#M67620</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2016-10-04T00:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228600#M67621</link>
      <description>&lt;P&gt;It seems like there is a field called &lt;CODE&gt;date&lt;/CODE&gt; in your event.  The field that is used for &lt;CODE&gt;_time&lt;/CODE&gt; is not the &lt;CODE&gt;date&lt;/CODE&gt; field. &lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 00:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228600#M67621</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-04T00:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228601#M67622</link>
      <description>&lt;P&gt;Thanks guys!&lt;BR /&gt;
Yes, MS IIS defines a "date" field in its log format that becomes part of the Splunk event.&lt;BR /&gt;
And that date/time appears to be in GMT (future).&lt;BR /&gt;
&lt;PRE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;H1&gt;Software: Microsoft Internet Information Services 8.5&lt;/H1&gt;

&lt;H1&gt;Version: 1.0&lt;/H1&gt;

&lt;H1&gt;Date: 2016-10-04 00:00:00&lt;/H1&gt;

&lt;H1&gt;Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken&lt;/H1&gt;

&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 00:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228601#M67622</guid>
      <dc:creator>nk-1</dc:creator>
      <dc:date>2016-10-04T00:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228602#M67623</link>
      <description>&lt;P&gt;Great!  &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;  I wonder how many others have gotten tangled up in this. &lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 01:05:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-date/m-p/228602#M67623</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2016-10-04T01:05:45Z</dc:date>
    </item>
  </channel>
</rss>

