<?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 search if a component has been down for some time and the event that it is up hasn't appeared for that period ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-if-a-component-has-been-down-for-some-time-and-the/m-p/313071#M93720</link>
    <description>&lt;P&gt;What happens when you simply remove the endswith=("component status up") part from your original query and adjust your where clause to either look for durations &amp;gt;600, or transactions without an "UP" event that are of a certain age?&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2018 10:23:45 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2018-02-27T10:23:45Z</dc:date>
    <item>
      <title>How to search if a component has been down for some time and the event that it is up hasn't appeared for that period ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-if-a-component-has-been-down-for-some-time-and-the/m-p/313070#M93719</link>
      <description>&lt;P&gt;Hello all !&lt;BR /&gt;
The task is to alert if a component (pool) is down for more than 10 minutes.&lt;/P&gt;

&lt;P&gt;Some details:&lt;BR /&gt;
There are down and up events for many pools (entry examples are below).&lt;BR /&gt;
So firstly I started using a transaction to find those pairs of events and compare the duration to the threshold - works perfectly (the search string is below).&lt;/P&gt;

&lt;P&gt;| transaction myvip pool_name_and_port mcpd_code&lt;BR /&gt;
startswith=("component status down")&lt;BR /&gt;
endswith=("component status up")&lt;BR /&gt;
| where duration&amp;gt;600&lt;/P&gt;

&lt;P&gt;But the problem is in order transaction to appear in the alert I always need the second message "up" (and delays can be hours/days), so it doesn't help to generate alerts immediately after the pool was down for more than 10 minutes.&lt;/P&gt;

&lt;P&gt;So, I need your help to detect that a component was down for more than some period of time (10 minutes in my case) and there is no "component status up" event in that period of time.&lt;/P&gt;

&lt;P&gt;Thank you in advance for any help !&lt;/P&gt;

&lt;P&gt;Entry examples:&lt;BR /&gt;
Feb 26 21:11:23 log_file_location_hostname_1 notice mcpd[9999]: 01070727:5: Pool /Common/myvip1/appname_pool member /Common/myhost1:10003 component status up. [ /Common/myvip1/appname_https_component: up ]  [ was down for 0hr:15mins:39sec ]&lt;BR /&gt;
Feb 26 21:11:22 log_file_location_hostname_2 notice mcpd[8888]: 01070727:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10003 component status up. [ /Common/myvip2/appname_https_component: up ]  [ was down for 0hr:15mins:35sec ]&lt;BR /&gt;
Feb 26 21:11:22 log_file_location_hostname_2 notice mcpd[8888]: 01070727:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10003 component status up. [ /Common/myvip2/appname_https_component: up ]  [ was down for 0hr:15mins:35sec ]&lt;BR /&gt;
Feb 26 21:11:21 log_file_location_hostname_3 notice mcpd[7777]: 01070727:5: Pool /Common/myvip1/appname_pool member /Common/myhost3:10003 component status up. [ /Common/myvip1/appname_https_component: up ]  [ was down for 0hr:15mins:34sec ]&lt;BR /&gt;
Feb 26 21:11:21 log_file_location_hostname_3 notice mcpd[7777]: 01070727:5: Pool /Common/myvip1/appname_pool member /Common/myhost3:10003 component status up. [ /Common/myvip1/appname_https_component: up ]  [ was down for 0hr:15mins:34sec ]&lt;BR /&gt;
Feb 26 21:00:37 log_file_location_hostname_1 notice mcpd[9999]: 01070727:5: Pool /Common/myvip1/appname_pool member /Common/myhost3:10004 component status up. [ /Common/myvip1/appname_https_component: up ]  [ was down for 0hr:17mins:45sec ]&lt;BR /&gt;
Feb 26 21:00:37 log_file_location_hostname_4 notice mcpd[6666]: 01070727:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10004 component status up. [ /Common/myvip2/appname_https_component: up ]  [ was down for 0hr:17mins:45sec ]&lt;BR /&gt;
Feb 26 21:00:37 log_file_location_hostname_4 notice mcpd[6666]: 01070727:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10004 component status up. [ /Common/myvip2/appname_https_component: up ]  [ was down for 0hr:17mins:45sec ]&lt;BR /&gt;
Feb 26 21:00:36 log_file_location_hostname_1 notice mcpd[9999]: 01070727:5: Pool /Common/myvip1/appname_pool member /Common/myhost1:10004 component status up. [ /Common/myvip1/appname_https_component: up ]  [ was down for 0hr:17mins:40sec ]&lt;BR /&gt;
Feb 26 21:00:36 log_file_location_hostname_1 notice mcpd[9999]: 01070727:5: Pool /Common/myvip1/appname_pool member /Common/myhost1:10004 component status up. [ /Common/myvip1/appname_https_component: up ]  [ was down for 0hr:17mins:40sec ]&lt;BR /&gt;
Feb 26 21:00:35 log_file_location_hostname_3 notice mcpd[7777]: 01070727:5: Pool /Common/myvip1/appname_pool member /Common/myhost1:10004 component status up. [ /Common/myvip1/appname_https_component: up ]  [ was down for 0hr:17mins:39sec ]&lt;BR /&gt;
Feb 26 21:00:35 log_file_location_hostname_2 notice mcpd[8888]: 01070727:5: Pool /Common/myvip2/appname_pool member /Common/myhost4:10004 component status up. [ /Common/myvip2/appname_https_component: up ]  [ was down for 0hr:17mins:39sec ]&lt;BR /&gt;
Feb 26 21:00:35 log_file_location_hostname_2 notice mcpd[8888]: 01070727:5: Pool /Common/myvip2/appname_pool member /Common/myhost4:10004 component status up. [ /Common/myvip2/appname_https_component: up ]  [ was down for 0hr:17mins:39sec ]&lt;BR /&gt;
Feb 26 21:00:34 log_file_location_hostname_3 notice mcpd[7777]: 01070727:5: Pool /Common/myvip1/appname_pool member /Common/myhost3:10004 component status up. [ /Common/myvip1/appname_https_component: up ]  [ was down for 0hr:17mins:39sec ]&lt;BR /&gt;
Feb 26 21:00:34 log_file_location_hostname_4 notice mcpd[6666]: 01070727:5: Pool /Common/myvip2/appname_pool member /Common/myhost4:10004 component status up. [ /Common/myvip2/appname_https_component: up ]  [ was down for 0hr:17mins:40sec ]&lt;BR /&gt;
Feb 26 21:00:33 log_file_location_hostname_2 notice mcpd[8888]: 01070727:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10004 component status up. [ /Common/myvip2/appname_https_component: up ]  [ was down for 0hr:17mins:39sec ]&lt;BR /&gt;
Feb 26 21:00:33 log_file_location_hostname_2 notice mcpd[8888]: 01070727:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10004 component status up. [ /Common/myvip2/appname_https_component: up ]  [ was down for 0hr:17mins:39sec ]&lt;BR /&gt;
Feb 26 20:55:47 log_file_location_hostname_2 notice mcpd[8888]: 01070638:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10003 component status down. [ /Common/myvip2/appname_https_component: down ]  [ was up for 0hr:1min:26sec ]&lt;BR /&gt;
Feb 26 20:55:47 log_file_location_hostname_3 notice mcpd[7777]: 01070638:5: Pool /Common/myvip1/appname_pool member /Common/myhost3:10003 component status down. [ /Common/myvip1/appname_https_component: down ]  [ was up for 0hr:1min:26sec ]&lt;BR /&gt;
Feb 26 20:55:47 log_file_location_hostname_2 notice mcpd[8888]: 01070638:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10003 component status down. [ /Common/myvip2/appname_https_component: down ]  [ was up for 0hr:1min:26sec ]&lt;BR /&gt;
Feb 26 20:55:47 log_file_location_hostname_3 notice mcpd[7777]: 01070638:5: Pool /Common/myvip1/appname_pool member /Common/myhost3:10003 component status down. [ /Common/myvip1/appname_https_component: down ]  [ was up for 0hr:1min:26sec ]&lt;BR /&gt;
Feb 26 20:55:46 log_file_location_hostname_4 notice mcpd[6666]: 01070638:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10003 component status down. [ /Common/myvip2/appname_https_component: down ]  [ was up for 0hr:1min:26sec ]&lt;BR /&gt;
Feb 26 20:55:46 log_file_location_hostname_4 notice mcpd[6666]: 01070638:5: Pool /Common/myvip2/appname_pool member /Common/myhost2:10003 component status down. [ /Common/myvip2/appname_https_component: down ]  [ was up for 0hr:1min:26sec ]&lt;BR /&gt;
Feb 26 20:55:45 log_file_location_hostname_1 notice mcpd[9999]: 01070638:5: Pool /Common/myvip1/appname_pool member /Common/myhost3:10003 component status down. [ /Common/myvip1/appname_https_component: down ]  [ was up for 0hr:1min:22sec ]&lt;BR /&gt;
Feb 26 20:55:45 log_file_location_hostname_4 notice mcpd[6666]: 01070638:5: Pool /Common/myvip2/appname_pool member /Common/myhost4:10003 component status down. [ /Common/myvip2/appname_https_component: down ]  [ was up for 0hr:1min:21sec ]&lt;BR /&gt;
Feb 26 20:55:45 log_file_location_hostname_2 notice mcpd[8888]: 01070638:5: Pool /Common/myvip2/appname_pool member /Common/myhost4:10003 component status down. [ /Common/myvip2/appname_https_component: down ]  [ was up for 0hr:1min:21sec ]&lt;BR /&gt;
Feb 26 20:55:45 log_file_location_hostname_4 notice mcpd[6666]: 01070638:5: Pool /Common/myvip2/appname_pool member /Common/myhost4:10003 component status down. [ /Common/myvip2/appname_https_component: down ]  [ was up for 0hr:1min:21sec ]&lt;BR /&gt;
Feb 26 20:55:45 log_file_location_hostname_2 notice mcpd[8888]: 01070638:5: Pool /Common/myvip2/appname_pool member /Common/myhost4:10003 component status down. [ /Common/myvip2/appname_https_component: down ]  [ was up for 0hr:1min:21sec ]&lt;BR /&gt;
Feb 26 20:55:45 log_file_location_hostname_1 notice mcpd[9999]: 01070638:5: Pool /Common/myvip1/appname_pool member /Common/myhost3:10003 component status down. [ /Common/myvip1/appname_https_component: down ]  [ was up for 0hr:1min:22sec ]&lt;BR /&gt;
Feb 26 20:55:44 log_file_location_hostname_3 notice mcpd[7777]: 01070638:5: Pool /Common/myvip1/appname_pool member /Common/myhost1:10003 component status down. [ /Common/myvip1/appname_https_component: down ]  [ was up for 0hr:1min:21sec ]&lt;BR /&gt;
Feb 26 20:55:44 log_file_location_hostname_1 notice mcpd[9999]: 01070638:5: Pool /Common/myvip1/appname_pool member /Common/myhost1:10003 component status down. [ /Common/myvip1/appname_https_component: down ]  [ was up for 0hr:1min:22sec ]&lt;BR /&gt;
Feb 26 20:55:44 log_file_location_hostname_3 notice mcpd[7777]: 01070638:5: Pool /Common/myvip1/appname_pool member /Common/myhost1:10003 component status down. [ /Common/myvip1/appname_https_component: down ]  [ was up for 0hr:1min:21sec ]&lt;BR /&gt;
Feb 26 20:55:44 log_file_location_hostname_1 notice mcpd[9999]: 01070638:5: Pool /Common/myvip1/appname_pool member /Common/myhost1:10003 component status down. [ /Common/myvip1/appname_https_component: down ]  [ was up for 0hr:1min:22sec ]&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:12:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-if-a-component-has-been-down-for-some-time-and-the/m-p/313070#M93719</guid>
      <dc:creator>alexeyglukhov</dc:creator>
      <dc:date>2020-09-29T18:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to search if a component has been down for some time and the event that it is up hasn't appeared for that period ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-if-a-component-has-been-down-for-some-time-and-the/m-p/313071#M93720</link>
      <description>&lt;P&gt;What happens when you simply remove the endswith=("component status up") part from your original query and adjust your where clause to either look for durations &amp;gt;600, or transactions without an "UP" event that are of a certain age?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 10:23:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-if-a-component-has-been-down-for-some-time-and-the/m-p/313071#M93720</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-02-27T10:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to search if a component has been down for some time and the event that it is up hasn't appeared for that period ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-if-a-component-has-been-down-for-some-time-and-the/m-p/313072#M93721</link>
      <description>&lt;P&gt;Hi Frank,&lt;/P&gt;

&lt;P&gt;Thank you very much for your suggestion - it works.&lt;BR /&gt;
I just recently started playing with Splunk and didn't know that "endwith=" is not a mandatory parameter for transaction.&lt;/P&gt;

&lt;P&gt;So, I modified the string as you pointed:&lt;/P&gt;

&lt;P&gt;| transaction myvip pool_name_and_port mcpd_code&lt;BR /&gt;
startswith=("component status down")&lt;BR /&gt;
| eval is_up_event_found=if(like(_raw, "%component status up%"), "yes", "no")&lt;BR /&gt;
| where duration&amp;gt;600 OR is_up_event_found="no"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:16:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-if-a-component-has-been-down-for-some-time-and-the/m-p/313072#M93721</guid>
      <dc:creator>alexeyglukhov</dc:creator>
      <dc:date>2020-09-29T18:16:24Z</dc:date>
    </item>
  </channel>
</rss>

