<?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 combine two searches to evaluate uptime percentage? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182026#M52483</link>
    <description>&lt;P&gt;Awesome looks like that did the trick after a small tweak!&lt;/P&gt;</description>
    <pubDate>Thu, 14 Aug 2014 18:54:30 GMT</pubDate>
    <dc:creator>brywilk_umich</dc:creator>
    <dc:date>2014-08-14T18:54:30Z</dc:date>
    <item>
      <title>How to combine two searches to evaluate uptime percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182024#M52481</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have nagios feeding data into splunk.  The below searches give me ping (up, down) and a service check (ok, critical).  While the separate searches seem to work great, I would like to combine them and have a overall uptime percentage for availability, and in the future will likely add more nagios checks to combine.  Both searches have a similar Server field.&lt;/P&gt;

&lt;P&gt;index=nagios perfdata="HOSTPERFDATA" tag::src_host=collaboration hoststate | eventstats count as "totalCount" | eventstats count as "choiceCount" by hoststate  | eval percent=(choiceCount/totalCount)*100 | stats values(percent) by hoststate&lt;/P&gt;

&lt;P&gt;index=nagios name="check__smtp" AND perfdata="SERVICEPERFDATA" tag::src_host=collaboration | eventstats count as "totalCount" | eventstats count as "choiceCount" by severity  | eval percent=(choiceCount/totalCount)*100 | stats values(percent) by severity&lt;/P&gt;

&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:20:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182024#M52481</guid>
      <dc:creator>brywilk_umich</dc:creator>
      <dc:date>2020-09-28T17:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches to evaluate uptime percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182025#M52482</link>
      <description>&lt;P&gt;Assuming host=down and severity=critical means host was not available, then try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=nagios  tag::src_host=collaboration (perfdata="HOSTPERFDATA" hoststate) OR (name="check__smtp" perfdata="SERVICEPERFDATA") | eval availabilityStatus=if(hoststate="down" OR severity="critical","Unavailable","Available" | stats count(eval(availabilityStatus="Unavailable")) as unavailCount, count as totalCount | eval percentAvailable=(unavailCount/totalCount)*100 | table percentAvailable
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Aug 2014 18:37:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182025#M52482</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-14T18:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches to evaluate uptime percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182026#M52483</link>
      <description>&lt;P&gt;Awesome looks like that did the trick after a small tweak!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 18:54:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182026#M52483</guid>
      <dc:creator>brywilk_umich</dc:creator>
      <dc:date>2014-08-14T18:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches to evaluate uptime percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182027#M52484</link>
      <description>&lt;P&gt;Found 1 little flaw, the percent available comes out to 0 if their arent any unavailable events.  Any thoughts on fixing that?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 19:08:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182027#M52484</guid>
      <dc:creator>brywilk_umich</dc:creator>
      <dc:date>2014-08-14T19:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches to evaluate uptime percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182028#M52485</link>
      <description>&lt;P&gt;Never mind I did a stats on Available and based the percentAvailable off of that.....&lt;/P&gt;

&lt;P&gt;thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 19:15:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-to-evaluate-uptime-percentage/m-p/182028#M52485</guid>
      <dc:creator>brywilk_umich</dc:creator>
      <dc:date>2014-08-14T19:15:22Z</dc:date>
    </item>
  </channel>
</rss>

