<?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 Calculating multiple counts in one search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427209#M171682</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I am trying to get the results for both the stats count in the code below. &lt;/P&gt;

&lt;P&gt;I'm getting no results when I do both counts together in the search but when I do them individually, the results shows up. Could I get some advice on this if I am doing anything wrong here. Thanks!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval reported=strftime(strptime(Reported_Date_Time,"%Y-%m-%d%H:%M:%S.%Q"),"%b")|eval resolved=strftime(strptime(Last_Resolved_Date_Time,"%Y-%m-%d%H:%M:%S.%Q"),"%b-%Y")
|stats count(Incident_Number) as inflow by reported | stats count(Incident_Number) as close by resolved
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 Apr 2019 02:58:44 GMT</pubDate>
    <dc:creator>synastraa</dc:creator>
    <dc:date>2019-04-26T02:58:44Z</dc:date>
    <item>
      <title>Calculating multiple counts in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427209#M171682</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I am trying to get the results for both the stats count in the code below. &lt;/P&gt;

&lt;P&gt;I'm getting no results when I do both counts together in the search but when I do them individually, the results shows up. Could I get some advice on this if I am doing anything wrong here. Thanks!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval reported=strftime(strptime(Reported_Date_Time,"%Y-%m-%d%H:%M:%S.%Q"),"%b")|eval resolved=strftime(strptime(Last_Resolved_Date_Time,"%Y-%m-%d%H:%M:%S.%Q"),"%b-%Y")
|stats count(Incident_Number) as inflow by reported | stats count(Incident_Number) as close by resolved
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 02:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427209#M171682</guid>
      <dc:creator>synastraa</dc:creator>
      <dc:date>2019-04-26T02:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating multiple counts in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427210#M171683</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | eval reported=strftime(strptime(Reported_Date_Time,"%Y-%m-%d%H:%M:%S.%Q"),"%b")
| eval resolved=strftime(strptime(Last_Resolved_Date_Time,"%Y-%m-%d%H:%M:%S.%Q"),"%b-%Y")
| multireport
[ stats count(Incident_Number) as inflow by reported ]
[ stats count(Incident_Number) as close by resolved ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 04:50:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427210#M171683</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-26T04:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating multiple counts in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427211#M171684</link>
      <description>&lt;P&gt;I have tried this out and only the first stats count results was displayed.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 06:00:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427211#M171684</guid>
      <dc:creator>synastraa</dc:creator>
      <dc:date>2019-04-26T06:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating multiple counts in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427212#M171685</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | eval reported=strftime(strptime(Reported_Date_Time,"%Y-%m-%d%H:%M:%S.%Q"),"%b")
| eval resolved=strftime(strptime(Last_Resolved_Date_Time,"%Y-%m-%d%H:%M:%S.%Q"),"%b-%Y")
| eval _time = coalesce(reported, resolved)
| eval Incident_Number = if(isnotnull(Incident_Number), _time, null())
| timechart count(Incident_Number) by Incident_Number
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 06:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427212#M171685</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-26T06:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating multiple counts in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427213#M171686</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;The results I'm looking for are as shown. Thanks!&lt;/P&gt;

&lt;P&gt;_time  Inflow  closed    (Inflow - closed)    ( accumulated (inflow - closed ) )&lt;BR /&gt;
Jan         10     |    5       |            5               |                         5&lt;BR /&gt;
Feb        10     |    5       |           5                |                        10&lt;BR /&gt;
Mar        20     |   7       |          13               |                        23&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 07:34:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427213#M171686</guid>
      <dc:creator>synastraa</dc:creator>
      <dc:date>2019-04-26T07:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating multiple counts in one search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427214#M171687</link>
      <description>&lt;P&gt;OK, now show us the raw events that would generate this result.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2019 00:56:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-multiple-counts-in-one-search/m-p/427214#M171687</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-27T00:56:50Z</dc:date>
    </item>
  </channel>
</rss>

