<?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 group by host, then severity, and include a count for each severity? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207978#M60611</link>
    <description>&lt;P&gt;Yep, that's the answer, thank you very much. This shows me how much I have to learn - that query is more complex than I expected it to be. Thanks again!&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jun 2016 19:58:37 GMT</pubDate>
    <dc:creator>_smp_</dc:creator>
    <dc:date>2016-06-14T19:58:37Z</dc:date>
    <item>
      <title>How to group by host, then severity, and include a count for each severity?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207971#M60604</link>
      <description>&lt;P&gt;I know this is probably very trivial to most, but I am a pretty new user. I am struggling quite a bit with a simple task: to group events by host, then severity, and include the count of each severity. I have gotten the closest with this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(severity) as Severity, count(severity) by severity, host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This comes close, but there are two things I need to change:&lt;BR /&gt;
1) The output includes an duplicate column of the severities&lt;BR /&gt;
2) The output contains the host in each row of output.&lt;/P&gt;

&lt;P&gt;Is it possible to group by host, then severity, and include a count for each severity? Like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;serverA    Low          20
           Medium       15
           High         11
serverB    Medium       6
           High         15
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2016 03:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207971#M60604</guid>
      <dc:creator>_smp_</dc:creator>
      <dc:date>2016-06-14T03:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by host, then severity, and include a count for each severity?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207972#M60605</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | chart count over host by severity | untable host severity count | stats values(severity) as Severity  values(count) as Count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2016 04:12:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207972#M60605</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-14T04:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by host, then severity, and include a count for each severity?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207973#M60606</link>
      <description>&lt;P&gt;Thanks for the reply. This is close, but not quite. There are two problems with this output:&lt;BR /&gt;
1) There is a "NULL" value for every group of severities, and the count is 0.&lt;BR /&gt;
2) Aside from the Count of Null values (0), there is only one other Count, instead of counting each Severity.&lt;/P&gt;

&lt;P&gt;The output looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;XXX.XX.XXX.XXX      NULL                 0
                      critical             901
                      high
                      informational
                      low
                      medium
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2016 12:57:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207973#M60606</guid>
      <dc:creator>_smp_</dc:creator>
      <dc:date>2016-06-14T12:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by host, then severity, and include a count for each severity?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207974#M60607</link>
      <description>&lt;P&gt;As I continue to scan Answers, I came across this which is pretty much what I'm after:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main | stats count by host severity&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Pretty simple. However, is there a way to group them by host, instead of separate lines for each unique combination of values?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 13:18:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207974#M60607</guid>
      <dc:creator>_smp_</dc:creator>
      <dc:date>2016-06-14T13:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by host, then severity, and include a count for each severity?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207975#M60608</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... severity="*" | chart count over host BY severity
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2016 19:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207975#M60608</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-14T19:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by host, then severity, and include a count for each severity?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207976#M60609</link>
      <description>&lt;P&gt;This should do it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main | stats count by host severity | stats list(severity) as severity list(count) as count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2016 19:51:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207976#M60609</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-14T19:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by host, then severity, and include a count for each severity?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207977#M60610</link>
      <description>&lt;P&gt;Thank you for the response. That seems to calculate the values correctly, but is there a way to display the results in the format I noted?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 19:53:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207977#M60610</guid>
      <dc:creator>_smp_</dc:creator>
      <dc:date>2016-06-14T19:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by host, then severity, and include a count for each severity?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207978#M60611</link>
      <description>&lt;P&gt;Yep, that's the answer, thank you very much. This shows me how much I have to learn - that query is more complex than I expected it to be. Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 19:58:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-host-then-severity-and-include-a-count-for-each/m-p/207978#M60611</guid>
      <dc:creator>_smp_</dc:creator>
      <dc:date>2016-06-14T19:58:37Z</dc:date>
    </item>
  </channel>
</rss>

