<?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 modify my search to calculate availability of multiple applications? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207462#M60488</link>
    <description>&lt;P&gt;Not sure I get the picture of what your final output should look like. Could you please provide your expected output, in tabular form may be, that you need (for the sum of total of failures)?&lt;/P&gt;

&lt;P&gt;Following suggestion is with some assumptions, give this a try&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;BR /&gt;
Fixed eval command and adjusted to expected output.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source=*** (service=*** OR service=***)
 | bucket span=m _time                           
 | stats count values(result) AS partResult by _time service
 | eval finalResult=if(isnotnull(mvfilter(match(partResult,"fail"))),1,0)
 | timechart span=m sum(finalResult) as Failures BY service
 | filldown
 | untable _time service failures
 | stats dc(_time) as TotalMinutes sum(failures) as TotalFailures by service 
 | eval Availability=100- round(TotalFailures*100/TotalMinutes,2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Sep 2016 16:03:36 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-09-23T16:03:36Z</dc:date>
    <item>
      <title>How to modify my search to calculate availability of multiple applications?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207461#M60487</link>
      <description>&lt;P&gt;I'm looking into creating equal availability across the board for different applications that are all being tested by the same tool.&lt;BR /&gt;
Because the tool that tests availability can be set to different intervals and can have multiple tests running against the same service, I need to normalise the data so the calculation can take into account different services and the tests beneath them.&lt;/P&gt;

&lt;P&gt;The flow of my idea is this:&lt;BR /&gt;
 1. Break the search time period down into minute buckets (shortest interval time)&lt;BR /&gt;
 2. Fill in empty buckets with the contents of the previous bucket&lt;BR /&gt;
 3. Any buckets with multiple events need to be singled down to one result, if there is at least 1 fail in there then the bucket is a fail.&lt;BR /&gt;
 4. calculate the availability for multiple services&lt;/P&gt;

&lt;P&gt;So far I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=*** (service=*** OR service=***)
| bucket span=m _time                           
| stats values(result) AS partResult by _time service
| eval finalResult=if(partResult="fail","fail",partResult)
| timechart span=m count(eval(finalResult="fail")) as Failures BY service
| filldown
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now this gives me whether the service is up or down at a specific minute and so it wouldn't matter if there are different run intervals.&lt;/P&gt;

&lt;P&gt;The problem I have is that I cannot sum the total of failures for the time period so I can calculate a percentage against the time period selected.&lt;/P&gt;

&lt;P&gt;The reason I have used Timechart is because it was the only way I knew of how to get every minute as a bucket in the selected time period.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 14:16:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207461#M60487</guid>
      <dc:creator>MattLingwood</dc:creator>
      <dc:date>2016-09-23T14:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to calculate availability of multiple applications?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207462#M60488</link>
      <description>&lt;P&gt;Not sure I get the picture of what your final output should look like. Could you please provide your expected output, in tabular form may be, that you need (for the sum of total of failures)?&lt;/P&gt;

&lt;P&gt;Following suggestion is with some assumptions, give this a try&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;BR /&gt;
Fixed eval command and adjusted to expected output.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source=*** (service=*** OR service=***)
 | bucket span=m _time                           
 | stats count values(result) AS partResult by _time service
 | eval finalResult=if(isnotnull(mvfilter(match(partResult,"fail"))),1,0)
 | timechart span=m sum(finalResult) as Failures BY service
 | filldown
 | untable _time service failures
 | stats dc(_time) as TotalMinutes sum(failures) as TotalFailures by service 
 | eval Availability=100- round(TotalFailures*100/TotalMinutes,2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Sep 2016 16:03:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207462#M60488</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-23T16:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to calculate availability of multiple applications?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207463#M60489</link>
      <description>&lt;P&gt;UPDATE:&lt;BR /&gt;
Output should look like:&lt;BR /&gt;
ServiceA, 100%&lt;BR /&gt;
ServiceB, 99.92%&lt;BR /&gt;
ServiceC, 100%&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 16:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207463#M60489</guid>
      <dc:creator>MattLingwood</dc:creator>
      <dc:date>2016-09-23T16:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to calculate availability of multiple applications?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207464#M60490</link>
      <description>&lt;P&gt;So trying this, I get an error with the if statement.&lt;/P&gt;

&lt;P&gt;I need to be able to calculate availability of 1 or more services separately. So that ServiceA is completely different to ServiceB as seen in my update comment.&lt;/P&gt;

&lt;P&gt;My algorithm to work it out was 100 - ( ( totalMinuteFailuresPerService / searchPeriodInMinutes ) * 100 ) &lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 16:40:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207464#M60490</guid>
      <dc:creator>MattLingwood</dc:creator>
      <dc:date>2016-09-23T16:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to calculate availability of multiple applications?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207465#M60491</link>
      <description>&lt;P&gt;Try the updated answer&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 16:57:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207465#M60491</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-23T16:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to calculate availability of multiple applications?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207466#M60492</link>
      <description>&lt;P&gt;This is a great solution! Thank you for your help&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 10:17:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207466#M60492</guid>
      <dc:creator>MattLingwood</dc:creator>
      <dc:date>2016-09-26T10:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to calculate availability of multiple applications?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207467#M60493</link>
      <description>&lt;P&gt;One addition I would add to this is: How can I manipulate the data so it would show it on a day by day basis see example.&lt;/P&gt;

&lt;P&gt;Day      ServiceA    ServiceB&lt;BR /&gt;
19/09   100%         100%&lt;BR /&gt;
20/09   100%         100%&lt;BR /&gt;
21/09   100%         100%&lt;BR /&gt;
22/09   99.95%      100%&lt;/P&gt;

&lt;P&gt;The main time range this will be done in is "Previous Week"&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 14:16:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207467#M60493</guid>
      <dc:creator>MattLingwood</dc:creator>
      <dc:date>2016-09-26T14:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to calculate availability of multiple applications?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207468#M60494</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=*** (service=*** OR service=***)
  | bucket span=m _time                           
  | stats count values(result) AS partResult by _time service
  | eval finalResult=if(isnotnull(mvfilter(match(partResult,"fail"))),1,0)
  | timechart span=m sum(finalResult) as Failures BY service
  | filldown
  | untable _time service failures | eval day=strftime(_time,"%m/%d/%Y")
  | stats dc(_time) as TotalMinutes sum(failures) as TotalFailures by day service 
  | eval Availability=100- round(TotalFailures*100/TotalMinutes,2)
  | chart values(Availability) over day by service
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Sep 2016 15:18:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207468#M60494</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-26T15:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to calculate availability of multiple applications?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207469#M60495</link>
      <description>&lt;P&gt;That's perfect, Thank you again!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 15:45:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-calculate-availability-of-multiple/m-p/207469#M60495</guid>
      <dc:creator>MattLingwood</dc:creator>
      <dc:date>2016-09-26T15:45:41Z</dc:date>
    </item>
  </channel>
</rss>

