<?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 Sum max(count) from multiple hosts in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163964#M46566</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have 4 hosts. Each host collects error logs. Each log consists of a Counter, like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-12-02 11:23:26,512 INFO  type=COUNTER error count=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So every time there is an error, the count=n part of the log increases.&lt;/P&gt;

&lt;P&gt;I want to plot the amount of errors over time. I've set up a field extraction, called ErrorCount, for the number within "count=n". Using max(count), I have used the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"type=COUNTER" ErrorCount=* host=lonrs10000 | timechart max(ErrorCount)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, I have 3 further hosts, with their own counters running. How can I edit my search to include the other 3 hosts data?&lt;/P&gt;

&lt;P&gt;E.g. for a specific day:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;the count of errors on host lonrs10000 = 5&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;the count of errors on host lonrs20000 = 4&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;the count of errors on host lonrs30000 = 2&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;the count of errors on host lonrs40000 = 0&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;The total for this specific day should be 11. I am looking to get the total number of errors as a result from my search.&lt;/P&gt;

&lt;P&gt;.&lt;/P&gt;

&lt;P&gt;Thanks a lot, &lt;/P&gt;

&lt;P&gt;Phil&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2013 11:49:44 GMT</pubDate>
    <dc:creator>philallen1</dc:creator>
    <dc:date>2013-12-03T11:49:44Z</dc:date>
    <item>
      <title>Sum max(count) from multiple hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163964#M46566</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have 4 hosts. Each host collects error logs. Each log consists of a Counter, like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-12-02 11:23:26,512 INFO  type=COUNTER error count=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So every time there is an error, the count=n part of the log increases.&lt;/P&gt;

&lt;P&gt;I want to plot the amount of errors over time. I've set up a field extraction, called ErrorCount, for the number within "count=n". Using max(count), I have used the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"type=COUNTER" ErrorCount=* host=lonrs10000 | timechart max(ErrorCount)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, I have 3 further hosts, with their own counters running. How can I edit my search to include the other 3 hosts data?&lt;/P&gt;

&lt;P&gt;E.g. for a specific day:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;the count of errors on host lonrs10000 = 5&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;the count of errors on host lonrs20000 = 4&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;the count of errors on host lonrs30000 = 2&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;the count of errors on host lonrs40000 = 0&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;The total for this specific day should be 11. I am looking to get the total number of errors as a result from my search.&lt;/P&gt;

&lt;P&gt;.&lt;/P&gt;

&lt;P&gt;Thanks a lot, &lt;/P&gt;

&lt;P&gt;Phil&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 11:49:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163964#M46566</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-12-03T11:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum max(count) from multiple hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163965#M46567</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"type=COUNTER" ErrorCount=* host=lonrs10000 OR host=lonrs20000 OR host=lonrs30000 OR host=lonrs40000  | timechart max(ErrorCount) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;regards&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 11:54:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163965#M46567</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2013-12-03T11:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sum max(count) from multiple hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163966#M46568</link>
      <description>&lt;P&gt;Hi, thanks for your response. The search that you added doesn't add the numbers together though. It displays them as 4 separate values? &lt;BR /&gt;
i.e. lonrs10000 = 5, lonrs20000 = 4... etc. Rather than total = 11. &lt;BR /&gt;
Do you see what I mean?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 11:59:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163966#M46568</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-12-03T11:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum max(count) from multiple hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163967#M46569</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I though you needed the data per host. If you just need the total remove the last part: "by host"&lt;/P&gt;

&lt;P&gt;EDIT: if you need both things, add this to the first query i gave you: | addcoltotals&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 12:02:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163967#M46569</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2013-12-03T12:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sum max(count) from multiple hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163968#M46570</link>
      <description>&lt;P&gt;If I remove the 'by host' then the results from the search will be just the greatest value from the 4 hosts.&lt;BR /&gt;
i.e. lonrs10000 = 5, lonrs20000 = 4, lonrs30000 = 2, lonrs30000 = 0&lt;BR /&gt;
The answer would be 5, with your solution.&lt;/P&gt;

&lt;P&gt;I need the answer to sum all of them, so the answer should be 5+4+2+0 = 11&lt;BR /&gt;
I hope that makes sense?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 12:12:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163968#M46570</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-12-03T12:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum max(count) from multiple hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163969#M46571</link>
      <description>&lt;P&gt;You are right,&lt;/P&gt;

&lt;P&gt;You can get it with the | adcoltotals, or also this way:&lt;/P&gt;

&lt;P&gt;"type=COUNTER" ErrorCount=* host=lonrs10000 OR host=lonrs20000 OR host=lonrs30000 OR host=lonrs40000  | timechart max(ErrorCount) as tempvalue by host | timechart sum(tempvalue)&lt;/P&gt;

&lt;P&gt;Try it and let me know if it works&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 12:20:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163969#M46571</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2013-12-03T12:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum max(count) from multiple hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163970#M46572</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Thanks for your help here, but I can't seem to get it working. When I use the query you suggested it doesn't give me any results. I understand what you're trying to do, but it just doesn't work for some reason. Any further ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 14:10:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163970#M46572</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-12-03T14:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sum max(count) from multiple hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163971#M46573</link>
      <description>&lt;P&gt;Can you try this:- (only limitation here is that you would have to specify the span for your chart, in bucket and in timechart both)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"type=COUNTER" ErrorCount=* host=lonrs10000 OR host=lonrs20000 OR host=lonrs30000 OR host=lonrs40000 | bucket _time span=1d | stats max(ErrorCount) as MaxErrorCount by host,_time | timechart span=1d sum(MaxErrorCount) as TotalErrors 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2013 15:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163971#M46573</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-12-03T15:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sum max(count) from multiple hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163972#M46574</link>
      <description>&lt;P&gt;This works. Thanks a lot. The timepicker on my dashboard still works too - although, obviously, won't display the chart very well on any time range less than a day.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 17:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sum-max-count-from-multiple-hosts/m-p/163972#M46574</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-12-03T17:13:20Z</dc:date>
    </item>
  </channel>
</rss>

