<?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: Suppress and alert when a resolving event is received in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745799#M241544</link>
    <description>&lt;P&gt;Thanks for the reply!&lt;/P&gt;&lt;P&gt;If I break down this query to just:&lt;/P&gt;&lt;P&gt;index=main ("SESSION_STATE_DOWN" OR "SESSION_STATE_UP") | dedup host&lt;/P&gt;&lt;P&gt;The only results are up sessions, the "dedup host" removes all of the down sessions. as they're from the same host&lt;/P&gt;&lt;P&gt;Does the remaining&lt;/P&gt;&lt;PRE&gt;| where match(_raw, "SESSION_STATE_DOWN") AND _time&amp;lt;relative_time(now(), "-60s")&lt;/PRE&gt;&lt;P&gt;only query the results from the | dedup host or the total query?&amp;nbsp; If yes, it will never find a "SESSION_STATE_DOWN", they are filtered out&lt;/P&gt;</description>
    <pubDate>Thu, 08 May 2025 19:30:29 GMT</pubDate>
    <dc:creator>dflynn235</dc:creator>
    <dc:date>2025-05-08T19:30:29Z</dc:date>
    <item>
      <title>Suppress and alert when a resolving event is received</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745717#M241524</link>
      <description>&lt;P&gt;I'm attempting to suppress an alert if a follow up event (condition) is received within 60 seconds of the initial event (condition) from the same host.&amp;nbsp; This is a network switch alerting for BFD neighbor down event.&amp;nbsp; I want to suppress the alert if a BFD neighbor up event is received within 60 seconds.&lt;/P&gt;&lt;P&gt;This is the event data received:&lt;/P&gt;&lt;P&gt;Initial BFD Down:&lt;BR /&gt;2025-05-07T07:20:40.482713-04:00 "switch_name" : 2025 May 7 07:20:40 EDT: %BFD-5-SESSION_STATE_DOWN: BFD session 1124073489 to neighbor "IP Address" on interface Vlan43 has gone down. Reason: Administratively Down.&lt;BR /&gt;host = "switch_name"&lt;/P&gt;&lt;P&gt;Second event to nullify the alert:&lt;/P&gt;&lt;P&gt;2025-05-07T07:20:41.482771-04:00 "switch_name" : 2025 May 7 07:20:41 EDT: %BFD-5-SESSION_STATE_UP: BFD session 1124073489 to neighbor "IP Address" on interface Vlan43 is up.&lt;BR /&gt;host = "switch_name"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 18:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745717#M241524</guid>
      <dc:creator>dflynn235</dc:creator>
      <dc:date>2025-05-07T18:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress and alert when a resolving event is received</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745723#M241525</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237743"&gt;@dflynn235&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the following do what you are looking for?&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval status=case(searchmatch("has gone down"),"Down",searchmatch("is up"),"Up",true(),"Unknown")
| rex "on interface (?&amp;lt;iface&amp;gt;[a-zA-Z0-9]+)"
| stats range(_time) as downTime latest(status) as latestStatus by iface
| where downTime&amp;gt;60&lt;/LI-CODE&gt;&lt;P&gt;Here is a working example with sample data, just add the | where to limit as required.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=1
| eval _raw="2025-05-07T07:20:40.482713-04:00 \"switch_name\" : 2025 May 7 07:20:40 EDT: %BFD-5-SESSION_STATE_DOWN: BFD session 1124073489 to neighbor \"IP Address\" on interface Vlan43 has gone down. Reason: Administratively Down."
| eval host="switch_name"
| append [| makeresults count=1
| eval _raw="2025-05-07T07:20:41.482771-04:00 \"switch_name\" : 2025 May 7 07:20:41 EDT: %BFD-5-SESSION_STATE_UP: BFD session 1124073489 to neighbor \"IP Address\" on interface Vlan43 is up."
| eval host="switch_name"]
| rex "^(?&amp;lt;timeStr&amp;gt;[^\s]+)"
| eval _time=strptime(timeStr,"%Y-%m-%dT%H:%M:%S.%6N%Z") 
| eval status=case(searchmatch("has gone down"),"Down",searchmatch("is up"),"Up",true(),"Unknown")
| rex "on interface (?&amp;lt;iface&amp;gt;[a-zA-Z0-9]+)"
| stats range(_time) as downTime latest(status) as latestStatus by iface&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1746645407149.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38899iE815C9D0F85FDF4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1746645407149.png" alt="livehybrid_0-1746645407149.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 19:17:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745723#M241525</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-05-07T19:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress and alert when a resolving event is received</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745724#M241526</link>
      <description>&lt;P&gt;Search for up/down events and take the most recent for each host (switch).&amp;nbsp; Discard all of the up events and anything newer than 60 seconds.&amp;nbsp; The remainder will be down events at least a minute old without a following up event.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo ("SESSION_STATE_DOWN" OR "SESSION_STATE_UP")
| dedup host
| where match(_raw, "SESSION_STATE_DOWN") AND _time&amp;lt;relative_time(now(), "-60s")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 19:20:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745724#M241526</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2025-05-07T19:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress and alert when a resolving event is received</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745799#M241544</link>
      <description>&lt;P&gt;Thanks for the reply!&lt;/P&gt;&lt;P&gt;If I break down this query to just:&lt;/P&gt;&lt;P&gt;index=main ("SESSION_STATE_DOWN" OR "SESSION_STATE_UP") | dedup host&lt;/P&gt;&lt;P&gt;The only results are up sessions, the "dedup host" removes all of the down sessions. as they're from the same host&lt;/P&gt;&lt;P&gt;Does the remaining&lt;/P&gt;&lt;PRE&gt;| where match(_raw, "SESSION_STATE_DOWN") AND _time&amp;lt;relative_time(now(), "-60s")&lt;/PRE&gt;&lt;P&gt;only query the results from the | dedup host or the total query?&amp;nbsp; If yes, it will never find a "SESSION_STATE_DOWN", they are filtered out&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 19:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745799#M241544</guid>
      <dc:creator>dflynn235</dc:creator>
      <dc:date>2025-05-08T19:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress and alert when a resolving event is received</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745808#M241546</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237743"&gt;@dflynn235&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Were you able to try the search I provided?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im happy to help work through this if theres an issue with this approach.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237743"&gt;@dflynn235&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the following do what you are looking for?&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;LI-CODE lang="markup"&gt;| eval status=case(searchmatch("has gone down"),"Down",searchmatch("is up"),"Up",true(),"Unknown")
| rex "on interface (?&amp;lt;iface&amp;gt;[a-zA-Z0-9]+)"
| stats range(_time) as downTime latest(status) as latestStatus by iface
| where downTime&amp;gt;60&lt;/LI-CODE&gt;&lt;P&gt;Here is a working example with sample data, just add the | where to limit as required.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=1
| eval _raw="2025-05-07T07:20:40.482713-04:00 \"switch_name\" : 2025 May 7 07:20:40 EDT: %BFD-5-SESSION_STATE_DOWN: BFD session 1124073489 to neighbor \"IP Address\" on interface Vlan43 has gone down. Reason: Administratively Down."
| eval host="switch_name"
| append [| makeresults count=1
| eval _raw="2025-05-07T07:20:41.482771-04:00 \"switch_name\" : 2025 May 7 07:20:41 EDT: %BFD-5-SESSION_STATE_UP: BFD session 1124073489 to neighbor \"IP Address\" on interface Vlan43 is up."
| eval host="switch_name"]
| rex "^(?&amp;lt;timeStr&amp;gt;[^\s]+)"
| eval _time=strptime(timeStr,"%Y-%m-%dT%H:%M:%S.%6N%Z") 
| eval status=case(searchmatch("has gone down"),"Down",searchmatch("is up"),"Up",true(),"Unknown")
| rex "on interface (?&amp;lt;iface&amp;gt;[a-zA-Z0-9]+)"
| stats range(_time) as downTime latest(status) as latestStatus by iface&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1746645407149.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38899iE815C9D0F85FDF4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1746645407149.png" alt="livehybrid_0-1746645407149.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 20:14:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745808#M241546</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-05-08T20:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress and alert when a resolving event is received</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745809#M241547</link>
      <description>&lt;P&gt;Each command works only with the results from the previous command.&lt;/P&gt;&lt;P&gt;If the most recent event from each host is SESSION_STATE_UP then your job is done since there are no down hosts.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;where&lt;/FONT&gt; command will find no SESSION_STATE_DOWN events so there are none to display or alert on.&amp;nbsp; This is the desired state (isn't it?).&lt;/P&gt;&lt;P&gt;OTOH, if a host currently is down then &lt;FONT face="courier new,courier"&gt;dedup host&lt;/FONT&gt; will return SESSION_STATE_DOWN for that host and the &lt;FONT face="courier new,courier"&gt;where&lt;/FONT&gt; command will decide if the host has been down long enough to worry about.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 20:31:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745809#M241547</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2025-05-08T20:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress and alert when a resolving event is received</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745811#M241548</link>
      <description>&lt;P&gt;Thanks for the reply!&lt;/P&gt;&lt;P&gt;I ran the query as is and received some odd results.&amp;nbsp; I slightly modified it as shown:&lt;/P&gt;&lt;P&gt;index=main sourcetype="cisco:ios" ("SESSION_STATE_DOWN" OR "SESSION_STATE_UP") | eval status=case(searchmatch("%BFD-5-SESSION_STATE_DOWN"),"Down",searchmatch("%BFD-5-SESSION_STATE_UP"),"Up",true(),"Unknown")&lt;BR /&gt;| rex "on interface (?&amp;lt;iface&amp;gt;[a-zA-Z0-9]+)"&lt;BR /&gt;| stats range(_time) as downTime latest(status) as latestStatus by iface&lt;BR /&gt;| where downTime&amp;lt;60&lt;/P&gt;&lt;P&gt;This produced 2 results for the past 7 days:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dflynn235_0-1746736475019.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38913i1F57FB06C2D07C32/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dflynn235_0-1746736475019.png" alt="dflynn235_0-1746736475019.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can this be run in realtime and alert be generated for a "LatestStatus" of Down?&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 20:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745811#M241548</guid>
      <dc:creator>dflynn235</dc:creator>
      <dc:date>2025-05-08T20:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress and alert when a resolving event is received</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745813#M241549</link>
      <description>&lt;P&gt;Understood.&amp;nbsp; To test this, I'll actually need to down an interface for at least 60 seconds to see the Down result.&amp;nbsp; I'll need to get a network engineer involved to test.&amp;nbsp; I will get back ASAP.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 20:43:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suppress-and-alert-when-a-resolving-event-is-received/m-p/745813#M241549</guid>
      <dc:creator>dflynn235</dc:creator>
      <dc:date>2025-05-08T20:43:47Z</dc:date>
    </item>
  </channel>
</rss>

