<?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 use search time range in stats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151944#M42559</link>
    <description>&lt;P&gt;Hi yuanliu,&lt;/P&gt;

&lt;P&gt;If you're after the span in &lt;CODE&gt;stats&lt;/CODE&gt; do something like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;field=value .... | bucket _time span=1d | stats count by field, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps to get you going ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Tue, 16 Dec 2014 19:15:06 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-12-16T19:15:06Z</dc:date>
    <item>
      <title>How to use search time range in stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151942#M42557</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;field=value earliest=-7d@d latest=@d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When there are many events in these 7 days, I can use earliest(_time) and latest(_time) (or if I'm lucky with data, even last(_time), first(_time)) to determine the time range, thereby determine frequency.  But when events are sparse, these functions differ too much from the specified earliest and latest time boundaries.  I initially thought &lt;CODE&gt;_span&lt;/CODE&gt; was available in stats, but it is not.  How can I access the time range in stats?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151942#M42557</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2020-09-28T18:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use search time range in stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151943#M42558</link>
      <description>&lt;P&gt;How about a Parent Search like : .....|stats count by field1,field2,field3,field4,field5,_time and the child search&lt;/P&gt;

&lt;P&gt;search base="Parent and use Timechart here?&lt;/P&gt;

&lt;P&gt;Pardon me if i am going tangents.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 18:36:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151943#M42558</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2014-12-16T18:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to use search time range in stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151944#M42559</link>
      <description>&lt;P&gt;Hi yuanliu,&lt;/P&gt;

&lt;P&gt;If you're after the span in &lt;CODE&gt;stats&lt;/CODE&gt; do something like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;field=value .... | bucket _time span=1d | stats count by field, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps to get you going ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 19:15:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151944#M42559</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-12-16T19:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use search time range in stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151945#M42560</link>
      <description>&lt;P&gt;If you mean how to get which timerange the search was run across, use the &lt;CODE&gt;addinfo&lt;/CODE&gt; command which adds fields with this information. See: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Addinfo"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Addinfo&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 19:27:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151945#M42560</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-12-16T19:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use search time range in stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151946#M42561</link>
      <description>&lt;P&gt;&lt;CODE&gt;addinfo&lt;/CODE&gt; is it.  Thanks @Ayn&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 19:34:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-time-range-in-stats/m-p/151946#M42561</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2014-12-16T19:34:05Z</dc:date>
    </item>
  </channel>
</rss>

