<?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 edit my search to calculate time availability based on gaps between logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-time-availability-based-on/m-p/281525#M84949</link>
    <description>&lt;P&gt;Thanks! it is working as should &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2016 07:48:55 GMT</pubDate>
    <dc:creator>kanet</dc:creator>
    <dc:date>2016-06-07T07:48:55Z</dc:date>
    <item>
      <title>How to edit my search to calculate time availability based on gaps between logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-time-availability-based-on/m-p/281523#M84947</link>
      <description>&lt;P&gt;I would like to calculate availability time based on gaps between logs&lt;BR /&gt;
so far I have this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=servers sourcetype=servers_data HostName=examplehost | streamstats current=f last(_time) as last_time by HostName  | eval gap = last_time - _time | where gap &amp;gt; 320  | convert ctime(last_time) as last_time | stats sum(gap) AS Unavailability_sec by HostName | addinfo  | eval range = info_max_time - info_min_time  | eval Availability= 100 - (Unavailability_sec* 100 / range) | stats count | eval msg = if(count!=0, Availability, "100" ) | table msg
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But when it reach gaps means count != 0 then its always showing no results found.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 14:11:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-time-availability-based-on/m-p/281523#M84947</guid>
      <dc:creator>kanet</dc:creator>
      <dc:date>2016-06-06T14:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate time availability based on gaps between logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-time-availability-based-on/m-p/281524#M84948</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=servers sourcetype=servers_data HostName=examplehost | streamstats current=f last(_time) as last_time by HostName  | eval gap = last_time - _time | eval Unavailability=if(gap &amp;gt; 320,gap,0)  | addinfo  | eval range = info_max_time - info_min_time | stats sum(Unavailability) AS Unavailability_sec max(range) as range by HostName  | eval Availability= 100 - (Unavailability_sec* 100 / range) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Gives availability per host.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 16:12:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-time-availability-based-on/m-p/281524#M84948</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-06T16:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate time availability based on gaps between logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-time-availability-based-on/m-p/281525#M84949</link>
      <description>&lt;P&gt;Thanks! it is working as should &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 07:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-time-availability-based-on/m-p/281525#M84949</guid>
      <dc:creator>kanet</dc:creator>
      <dc:date>2016-06-07T07:48:55Z</dc:date>
    </item>
  </channel>
</rss>

