<?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: Calculation of availability in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537594#M36750</link>
    <description>&lt;PRE&gt;&lt;SPAN&gt;Hello @rnowitzki, &lt;BR /&gt;I would like to ask you one last question, is it possible to know the number of seconds between earliest and latest based on relative time?&lt;/SPAN&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 28 Jan 2021 10:34:37 GMT</pubDate>
    <dc:creator>wcastillocruz</dc:creator>
    <dc:date>2021-01-28T10:34:37Z</dc:date>
    <item>
      <title>Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/536653#M36637</link>
      <description>&lt;DIV class="lia-message-subject"&gt;&lt;SPAN&gt;Hello Community, I am asking you today to ask you for help concerning a project that I manage in my company. This is the availability calculation: I carry out the availability calculation by retrieving the critical alerts on ITRS (ITRS database) which are then indexed on splunk via the Splunk_DB_Connect application, then by applying a formula to tilt the unavailability then availability over a given time (24 hours or a week). my question is the following : when it comes to a cluster of servers (Active, Passive), I only take into account critical alerts if they are generated at the same time by the two members of a cluster (the active and passive servers). At the moment all the critical alerts generated by the 2 members of the cluster are indexed but I want to filter them in order to take the alert only if the two servers have emitted them at the same time or that the alert of the two server has been generated while server 1 was in critical condition and viseversa. do you have any idea how i can do this filtering? the final goal is to create an availability dashboard with graphics. thank you in advance for your help.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Jan 2021 10:03:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/536653#M36637</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-01-21T10:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/536655#M36638</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229427"&gt;@wcastillocruz&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;We could provide better help, if you'd show some example logs.&lt;BR /&gt;&lt;BR /&gt;But in general you could have a logic like:&lt;BR /&gt;&lt;BR /&gt;If condition of pair_member_1 AND condition of pair_member_2 is critical, then alert.&lt;BR /&gt;(this is not SPL, just to write out the logic &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&lt;/P&gt;&lt;P&gt;You could apply this logic to a timeframe of 5 minutes for example. So, if both of the pair members are critical within a 5 minute window, an alert is triggered (or a flag is set, bulb in your office goes red... whatever you need &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt; ).&lt;BR /&gt;&lt;BR /&gt;If you provide some (anonymized) samples, how your data looks like, we could help you with more details, like how to implement the logic in a search and how to trigger an alert based on it.&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 10:23:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/536655#M36638</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2021-01-21T10:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/536684#M36640</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/64317"&gt;@rnowitzki&lt;/a&gt;, Thank you for your reply. I have provided you with a screenshot of two indexed events (each event consists of 2 alerts: a critical alert and a return to normal alert) these events are generated from two member servers of a cluster but they are not happening at the same time, then availability is not affected because while one member was in critical condition, the second was providing service. my goal is to find events that happened at the same time or that both servers were in critical state at some point, even though the alerts did not occur at the same time, for example : server 1 deploys an alert on 01/21/2021 at 3:00 p.m. and server 2 generated an alert on 01/21/2021 at 3:20 p.m. while the server was still in critical mode. I have to find a way to create this condition in SPL. Thank you&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture_01-21.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12623i970777665F39065A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture_01-21.PNG" alt="Capture_01-21.PNG" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 13:42:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/536684#M36640</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-01-21T13:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/536719#M36652</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229427"&gt;@wcastillocruz&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;This should do it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=5
| streamstats count as id
| eval _time = case(id=1,_time-6000,id=2,_time-12000,id=3,_time-18000,id=4,_time-23000,id=5,_time-23000)
| sort _time
| eval severity=case(id=1,2,id=2,0,id=3,2,id=4,2,id=5,0)
| eval host = case(id=1,"A",id=2,"B",id=3,"A",id=4,"B",id=5,"A")

| timechart latest(severity) by host
| filldown A,B
| eval super_mega_alert=if(A=2 AND B=2,"yes","no")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will only need the last 3 lines. The others are just to make up some sample data.&lt;BR /&gt;&lt;BR /&gt;Add a span to the timechart that fits your need, e.g. span=5m to monitor 5 minute windows.&lt;BR /&gt;You have the change A and B to the hostnames in your data.&lt;BR /&gt;&lt;BR /&gt;Try to add the commands one after another to see and understand the logic.&lt;BR /&gt;&lt;BR /&gt;So first only add the timechart command. You might have to change "host" to whatever fields your device name is in ("managed_entity" maybe?).&lt;BR /&gt;You will see many lines with no values, that's where the filldown comes in. It adds the last known value to any field...which is valid because there was no change of state in the meantime.&lt;BR /&gt;The last line just checks when both of the nodes had severity 2 in the same timeframe and puts a yes in the new field super_mega_alert which you can use to trigger your alert.&lt;BR /&gt;&lt;BR /&gt;Let me know if you have any further questions&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 16:40:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/536719#M36652</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2021-01-21T16:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537017#M36704</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/64317"&gt;@rnowitzki&lt;/a&gt;, thank you for answering so quickly. I analyzed and tried your solution, which seems very good to me, but I do not obtain the desired result. I managed to put down on paper the desired SPL research: this is based on my previous screenshot, an event is composed of two alerts: a Critical alert "represents the startime of event" and an OK alert "represents the endtime of event" in a generic search how I identify the startime and the endtime of the event? Thanks for your help&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 09:56:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537017#M36704</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-01-25T09:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537023#M36705</link>
      <description>&lt;P&gt;when i regroup the alerts to make event the two times temps are in the same fiel "timestamp start and timestamp end"&amp;nbsp;&lt;SPAN&gt;how I can do to separate two values ​​contained in the same field. values ​​are separated by a space&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 10:26:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537023#M36705</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-01-25T10:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537168#M36714</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229427"&gt;@wcastillocruz&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;working with "transaction" as you did is also an option, yes.&lt;BR /&gt;Dependent on how much data you look at, the performance might be not so nice...but it should give you what you need.&amp;nbsp; You could add endswith=(severity=0) to the command. Maybe it gives better results.&lt;BR /&gt;&lt;BR /&gt;To your question on how to seperate the timestamp field from you screenshot:&lt;BR /&gt;&lt;BR /&gt;I see two options, please adjust to your needs.&lt;BR /&gt;- | mvexpand timestamp&amp;nbsp; =&amp;gt; this will create 2 lines, each with one of the timestamps.&lt;BR /&gt;- | rex field=timestamp "(?&amp;lt;timestampA&amp;gt;\d*)\n?\r?\s?(?&amp;lt;timestampB&amp;gt;\d*)"&amp;nbsp; &amp;nbsp;=&amp;gt; puts the timestamps in 2 new fields.&amp;nbsp; Can be seperated by new line or space.&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 09:14:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537168#M36714</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2021-01-26T09:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537592#M36749</link>
      <description>&lt;P&gt;i used this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;|&amp;nbsp;eval start_time=mvindex(timestamp,0), end_time=mvindex(timestamp,1)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 10:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537592#M36749</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-01-28T10:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537594#M36750</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;Hello @rnowitzki, &lt;BR /&gt;I would like to ask you one last question, is it possible to know the number of seconds between earliest and latest based on relative time?&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jan 2021 10:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537594#M36750</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-01-28T10:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537599#M36752</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229427"&gt;@wcastillocruz&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;transaction will add a "duration" field, which i think is what you are looking for.&lt;BR /&gt;You can also subtract earliest from latest to a new field.&amp;nbsp;&lt;BR /&gt;| eval seconds=latest-earliest&lt;BR /&gt;&lt;BR /&gt;Or did I missunderstood?&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 10:56:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537599#M36752</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2021-01-28T10:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537603#M36754</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I may have explained myself badly. I have to calculate the availability of a service over a period which can be a year, a month, last week, month to date etc ... in my dashboard I have a time button where you can select the desired period to calculate the availability. so I have to create a formula that calculates the availability but there is a variant which is the number of seconds of the period over which we calculate the availability, I put my desired search:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;index=index_sqlprod-itrs_toc&lt;/P&gt;&lt;P&gt;| eval ID=Env+"_"+Apps+"_"+Function+"_"+varname&lt;/P&gt;&lt;P&gt;| transaction ID startswith=(severity=2) maxevents=2&lt;/P&gt;&lt;P&gt;| eval start_time=mvindex(timestamp,0), end_time=mvindex(timestamp,1)&lt;/P&gt;&lt;P&gt;| eval periode = $earliest$ - $latest$&amp;nbsp; &amp;nbsp; &amp;nbsp; """""&lt;SPAN&gt;these variables will look for the earliest and latest of my time button according to the selected period&lt;/SPAN&gt;&lt;SPAN&gt;"""""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;| stats sum(duration) AS duration_indispo by Function&lt;/P&gt;&lt;P&gt;| eval Percent_Available = round((periode - duration_indispo)*100/periode,4)&amp;nbsp; """""&lt;SPAN&gt;here I use the result to calculate the availability according to the desired period&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;"""""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;but the search is not working. thk for your help&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 11:50:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537603#M36754</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-01-28T11:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537613#M36757</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/64317"&gt;@rnowitzki&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 13:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537613#M36757</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-01-28T13:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of availability</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537665#M36765</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229427"&gt;@wcastillocruz&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;What exactly does not work. No output or wrong output, errors?&lt;BR /&gt;&lt;BR /&gt;Some trouble shooting suggestions:&lt;BR /&gt;&lt;BR /&gt;Are the tokens actually working?&amp;nbsp;&lt;BR /&gt;Maybe check with this simple evals:&lt;BR /&gt;&lt;BR /&gt;| eval first=$earliest$&lt;BR /&gt;| eval last=$latest$&lt;BR /&gt;| table first, last&lt;BR /&gt;&lt;BR /&gt;If they actually contain the data, then the next thing is to check if the calculation is correct.&lt;BR /&gt;I think you have to change the order in your math like;&lt;BR /&gt;&lt;SPAN&gt;&lt;EM&gt;| eval periode =&amp;nbsp;$latest$ -&amp;nbsp; $earliest$&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;In epoch seconds, "latest" is the bigger number, so extract earliest from latest.&lt;/P&gt;&lt;P&gt;Check these 2 items. If it still does not work, try to debug by removing one SPL line after another to check if the disired output comes.&lt;/P&gt;&lt;P&gt;So, first remove the last line to check if&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; | stats sum(duration) AS duration_indispo by Function&lt;/EM&gt;&lt;BR /&gt;results in a valid number for&amp;nbsp;&lt;EM&gt;duration_indispo&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If not, remove the line also to check if &lt;EM&gt;periode&amp;nbsp;&amp;nbsp;&lt;/EM&gt;has the corret value and so on.&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 17:01:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculation-of-availability/m-p/537665#M36765</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2021-01-28T17:01:38Z</dc:date>
    </item>
  </channel>
</rss>

