<?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: calculates the availability of a service with active server and passive server in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/541656#M153365</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;/P&gt;&lt;P&gt;The problem may be the sort order. Transaction command requires descending order. Please try sorting desc.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.2/SearchReference/Transaction#Descending_time_order_required" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.2/SearchReference/Transaction#Descending_time_order_required&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Feb 2021 11:38:19 GMT</pubDate>
    <dc:creator>scelikok</dc:creator>
    <dc:date>2021-02-28T11:38:19Z</dc:date>
    <item>
      <title>calculates the availability of a service with active server and passive server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/539282#M152529</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/64317"&gt;@rnowitzki&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/136781"&gt;@renjith_nair&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;could you help me on the following question please:&lt;/P&gt;&lt;P&gt;I index every day at 6 p.m. splunk events from an ITRS database. each event is made up of a critical alert and an OK alert generated by ITRS. the events concern a pair of servers (Active and passive) I have to define a search with a condition like this:&lt;BR /&gt;if server1 K0&lt;BR /&gt;AND server2 K0&lt;BR /&gt;AND server1 0K after server2 is K0&lt;BR /&gt;then I calculate the time of the last K0 servers and the first 0K server&lt;BR /&gt;this corresponds to the downtime of my service&lt;BR /&gt;but only if both servers are KO'd at the same time.&lt;BR /&gt;i.e if server1 K0 at 3pm&lt;BR /&gt;AND server2 K0 at 3:30 p.m.&lt;BR /&gt;BUT server1 0K at 3:20 p.m.&lt;BR /&gt;then do nothing&lt;/P&gt;&lt;P&gt;i have this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=index (severity=2 OR severity=0 OR severity="-1" OR severity=1) server=server1 OR server=server2&lt;BR /&gt;| eval ID=Service+"_"+Env+"_"+Apps+"_"+Function+"_"+managed_entity+"_"+varname&lt;BR /&gt;| addinfo&lt;BR /&gt;| eval periode=info_max_time-info_min_time&lt;BR /&gt;| transaction ID startswith=(severity=2) maxevents=2&amp;nbsp;&lt;/P&gt;&lt;P&gt;i dont now how to create condition&lt;/P&gt;&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 12:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/539282#M152529</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-02-10T12:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: calculates the availability of a service with active server and passive server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/539298#M152533</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;Isn't this the same use case that we discussed some weeks ago?&lt;BR /&gt;Did it not work for you?&lt;BR /&gt;&lt;BR /&gt;Anyways:&lt;BR /&gt;What should be returned at the end, do you need the total duration of downtime, or a table where you see when the service was down?&lt;BR /&gt;&lt;BR /&gt;In general, this should be a starting point:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| timechart span=5m latest(severity) by server
| filldown
| eval servicedown=if(server1=2 AND server2=2,"yes","no")&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;This will give you a table of timestamps where the service was down, because both of the servers had severity 2 at the same time.&lt;BR /&gt;&lt;BR /&gt;To get the duration of the downtime, you could work with transaction or streamstats for example.&lt;BR /&gt;But please clarify what the information is that you need to report from this.&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 13:43:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/539298#M152533</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2021-02-10T13:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: calculates the availability of a service with active server and passive server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/539299#M152534</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;/P&gt;&lt;P&gt;Since you did not mention the relation between severity and OK/OK, I assumed positive severity is KO, negative severity is OK. You can update peer_failed eval according to your definition of failure.&lt;/P&gt;&lt;P&gt;Please try below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index (severity=2 OR severity=0 OR severity="-1" OR severity=1) server=server1 OR server=server2
| eval ID=Service+"_"+Env+"_"+Apps+"_"+Function+"_"+managed_entity+"_"+varname
| addinfo
| eval periode=info_max_time-info_min_time
| eval peer_failed=if(severity&amp;gt;0,1,-1)
| streamstats sum(peer_failed) as failed_peers by ID
| transaction ID startswith=(failed_peers=2) endswith=(failed_peers&amp;lt;2) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 13:48:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/539299#M152534</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-02-10T13:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: calculates the availability of a service with active server and passive server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/541574#M153336</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know where the error is in my search, could you help me, I would like to form a transaction with each event 2 and 3 in the failed_peers column of my table in time order. but I get a "not found" result while events exist&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;this is my search :&lt;/P&gt;&lt;P&gt;index=index_sqlprod-itrs_toc (managed_entity="vmc-neorc-20 - rec" OR managed_entity="vmc-neorc-19 - rec") rowname="ASC RecordingControl"&lt;BR /&gt;| eval ID=Service+"_"+Env+"_"+Apps+"_"+Function+"_"+varname&lt;BR /&gt;| addinfo&lt;BR /&gt;|sort _time asc&lt;BR /&gt;| eval peer_failed=if(severity=2,1,-1)&lt;BR /&gt;| streamstats sum(peer_failed) as failed_peers by ID&lt;BR /&gt;| eval failed_peers=if((failed_peers=1) AND (severity="0" OR severity="-1"),3,failed_peers)&lt;BR /&gt;|where NOT (failed_peers=1)&lt;BR /&gt;|transaction ID startswith=(failed_peers=2) endswith=(failed_peers=3) maxevents=2&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2 is my second critical alert 3 is my first OK alert after 2 critical alerts&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wcastillocruz_0-1614366085751.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13098i7B9BADEB22A53795/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wcastillocruz_0-1614366085751.png" alt="wcastillocruz_0-1614366085751.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;here is the failed peers column whose values ​​my search should follow in temporal order, but it's not like that.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 19:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/541574#M153336</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-02-26T19:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: calculates the availability of a service with active server and passive server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/541656#M153365</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;/P&gt;&lt;P&gt;The problem may be the sort order. Transaction command requires descending order. Please try sorting desc.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.2/SearchReference/Transaction#Descending_time_order_required" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.2/SearchReference/Transaction#Descending_time_order_required&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 11:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/541656#M153365</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-02-28T11:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: calculates the availability of a service with active server and passive server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/541715#M153378</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;,&lt;BR /&gt;Thank you for always being there despite the complexity of my questions.&lt;BR /&gt;in my case i can't use the desc sort, because it disrupts my streamstats sum. here is a screenshot of what i get in my failed_peers with desc sort.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wcastillocruz_0-1614588282033.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13115iC81EF872481C7A9A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wcastillocruz_0-1614588282033.png" alt="wcastillocruz_0-1614588282033.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 08:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/541715#M153378</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-03-01T08:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: calculates the availability of a service with active server and passive server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/542010#M153516</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;/P&gt;&lt;P&gt;Can you try sort ascending only before transaction command?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_sqlprod-itrs_toc (managed_entity="vmc-neorc-20 - rec" OR managed_entity="vmc-neorc-19 - rec") rowname="ASC RecordingControl"
| eval ID=Service+"_"+Env+"_"+Apps+"_"+Function+"_"+varname
| addinfo
| sort _time asc
| eval peer_failed=if(severity=2,1,-1)
| streamstats sum(peer_failed) as failed_peers by ID
| eval failed_peers=if((failed_peers=1) AND (severity="0" OR severity="-1"),3,failed_peers)
| where NOT (failed_peers=1)
| sort - _time  
| transaction ID startswith=(failed_peers=2) endswith=(failed_peers=3) maxevents=2&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 Mar 2021 16:40:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/542010#M153516</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-03-02T16:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: calculates the availability of a service with active server and passive server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/542146#M153567</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it works!!!!!!!&lt;BR /&gt;thank you&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 12:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/542146#M153567</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-03-03T12:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: calculates the availability of a service with active server and passive server</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/542267#M153602</link>
      <description>&lt;P&gt;Great!, can you please mark as accepted solution for helping to other users.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 22:24:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculates-the-availability-of-a-service-with-active-server-and/m-p/542267#M153602</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-03-03T22:24:52Z</dc:date>
    </item>
  </channel>
</rss>

