<?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 Display count for multiple time increments in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-count-for-multiple-time-increments/m-p/46206#M11047</link>
    <description>&lt;P&gt;I have log data that tracks the completion of jobs. I'd like to be able to track the completed jobs, but for 4 different increments: the last 5 minutes, last 30 minutes, last hour, and last 24 hours, and I'd like it to be displayed in a table, something like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;JobType | 5mins  | 30mins | 60mins | 24hrs  
AA          2        30      100       150
BB          0        10       20        30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the data resembles something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;timestamp&amp;gt; JobType=AA status=Finished
&amp;lt;timestamp&amp;gt; JobType=BB status=Finished
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can do a count on status=Finished and dump that to a simpleResultsTable by JobType for the entire log file or for a single start/end period. But how would I send that to a simpleResultsTable for multiple increments?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2011 22:13:28 GMT</pubDate>
    <dc:creator>cejohnson</dc:creator>
    <dc:date>2011-07-20T22:13:28Z</dc:date>
    <item>
      <title>Display count for multiple time increments</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-count-for-multiple-time-increments/m-p/46206#M11047</link>
      <description>&lt;P&gt;I have log data that tracks the completion of jobs. I'd like to be able to track the completed jobs, but for 4 different increments: the last 5 minutes, last 30 minutes, last hour, and last 24 hours, and I'd like it to be displayed in a table, something like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;JobType | 5mins  | 30mins | 60mins | 24hrs  
AA          2        30      100       150
BB          0        10       20        30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the data resembles something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;timestamp&amp;gt; JobType=AA status=Finished
&amp;lt;timestamp&amp;gt; JobType=BB status=Finished
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can do a count on status=Finished and dump that to a simpleResultsTable by JobType for the entire log file or for a single start/end period. But how would I send that to a simpleResultsTable for multiple increments?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2011 22:13:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-count-for-multiple-time-increments/m-p/46206#M11047</guid>
      <dc:creator>cejohnson</dc:creator>
      <dc:date>2011-07-20T22:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Display count for multiple time increments</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-count-for-multiple-time-increments/m-p/46207#M11048</link>
      <description>&lt;P&gt;You should be able to use eval and relative_time to sort this one out:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;status=Finished 
      | stats sum(eval(if(_time &amp;gt; relative_time(now(), "-5m"),1,0))) as 5mins,  
              sum(eval(if(_time &amp;gt; relative_time(now(), "-30m"),1,0))) as 30mins,  
              sum(eval(if(_time &amp;gt; relative_time(now(), "-60m"),1,0))) as 60mins,  
              sum(eval(if(_time &amp;gt; relative_time(now(), "-24h"),1,0))) as 24hrs by JobType
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if that works.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2011 22:54:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-count-for-multiple-time-increments/m-p/46207#M11048</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2011-07-20T22:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Display count for multiple time increments</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-count-for-multiple-time-increments/m-p/46208#M11049</link>
      <description>&lt;P&gt;Yes that works. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2011 23:33:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-count-for-multiple-time-increments/m-p/46208#M11049</guid>
      <dc:creator>cejohnson</dc:creator>
      <dc:date>2011-07-20T23:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Display count for multiple time increments</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-count-for-multiple-time-increments/m-p/46209#M11050</link>
      <description>&lt;P&gt;Excellent! I'm glad to hear that.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2011 07:33:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-count-for-multiple-time-increments/m-p/46209#M11050</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2011-07-22T07:33:29Z</dc:date>
    </item>
  </channel>
</rss>

