<?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: Trigger an alert after comparing two search results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Trigger-an-alert-after-comparing-two-search-results/m-p/540982#M153127</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222559"&gt;@NatSec&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please, try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (sync_status="out-of-sync" OR sync_status="in-sync" 
| stats dc(sync_status) AS dc_sync_status values(sync_status) AS sync_status BY host
| where dc_sync_status =1 AND sync_status="out-of-sync"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can schedule an alert running every hours on a time period of an hour using this search that triggers when you have only sync_status="out-of-sync" in the last hour for one host.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 23 Feb 2021 10:20:29 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-02-23T10:20:29Z</dc:date>
    <item>
      <title>Trigger an alert after comparing two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trigger-an-alert-after-comparing-two-search-results/m-p/540979#M153125</link>
      <description>&lt;P&gt;I have two search conditions that I need to trigger alerts from. I have a hundred hosts on a HA cluster. Sometimes host(s)&amp;nbsp; happen to leave an HA cluster and come back online, due to network issues or during a production changes by engineers. When a host leaves the HA cluster, I get a single message in Splunk that reads "serverX has gone out-of-sync". When the host joins back the HA cluster, I get a single message in Splunk that reads&amp;nbsp; "serverX has gone in-sync". This means I have two search results to play with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Goal: When a host leaves the HA cluster and comes back within an hour, do not send any alerts. But if a host leaves an HA cluster, but does not come back online after an hour, trigger an alert.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I have done so far (search period =1hr):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test sync_status="out-of-sync" [search index=test sync_status="in-sync" | dedup server | table server]&lt;/LI-CODE&gt;&lt;P&gt;I get undesired results. I expect to see only the host that went offline but did not join back the cluster (of which I can see results when I do simple searches).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I in the right direction, from a search and logic perspective? Are they better search methods of doing it?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 09:54:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trigger-an-alert-after-comparing-two-search-results/m-p/540979#M153125</guid>
      <dc:creator>NatSec</dc:creator>
      <dc:date>2021-02-23T09:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger an alert after comparing two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trigger-an-alert-after-comparing-two-search-results/m-p/540982#M153127</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222559"&gt;@NatSec&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please, try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (sync_status="out-of-sync" OR sync_status="in-sync" 
| stats dc(sync_status) AS dc_sync_status values(sync_status) AS sync_status BY host
| where dc_sync_status =1 AND sync_status="out-of-sync"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can schedule an alert running every hours on a time period of an hour using this search that triggers when you have only sync_status="out-of-sync" in the last hour for one host.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 10:20:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trigger-an-alert-after-comparing-two-search-results/m-p/540982#M153127</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-02-23T10:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger an alert after comparing two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trigger-an-alert-after-comparing-two-search-results/m-p/541053#M153164</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; This is perfect.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 17:35:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trigger-an-alert-after-comparing-two-search-results/m-p/541053#M153164</guid>
      <dc:creator>NatSec</dc:creator>
      <dc:date>2021-02-23T17:35:33Z</dc:date>
    </item>
  </channel>
</rss>

