<?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: Search that alerts if one event exists and another does not in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-that-alerts-if-one-event-exists-and-another-does-not/m-p/275954#M83251</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | transaction startswith=event="file_change" endswith=event="git_commit" | where duration&amp;gt;300
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 28 Oct 2016 14:49:02 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-10-28T14:49:02Z</dc:date>
    <item>
      <title>Search that alerts if one event exists and another does not</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-that-alerts-if-one-event-exists-and-another-does-not/m-p/275952#M83249</link>
      <description>&lt;P&gt;I have two types of events in the same index:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-10-27 00:43:49.722 event=file_change
2016-10-27 00:43:54.000 event=git_commit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to alert specifically when event=git_commit does NOT occur within 5 minutes of event=file_change&lt;/P&gt;

&lt;P&gt;It seems that there are a few ways to go about this, using join or append or transaction - but given that my end goal is just an alert that one event exists without the other, I'm not sure which is the best search command to go with, given that I need a "if this and NOT that, alert". Any suggestions welcome!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:34:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-that-alerts-if-one-event-exists-and-another-does-not/m-p/275952#M83249</guid>
      <dc:creator>hcannon</dc:creator>
      <dc:date>2020-09-29T11:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Search that alerts if one event exists and another does not</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-that-alerts-if-one-event-exists-and-another-does-not/m-p/275953#M83250</link>
      <description>&lt;P&gt;I'd use transaction&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|transaction event startswith="file_change" max_span=5m|search eventcount=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that should give you any transaction that only has a file_change with no git_commit within 5 minutes.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:37:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-that-alerts-if-one-event-exists-and-another-does-not/m-p/275953#M83250</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-29T11:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Search that alerts if one event exists and another does not</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-that-alerts-if-one-event-exists-and-another-does-not/m-p/275954#M83251</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | transaction startswith=event="file_change" endswith=event="git_commit" | where duration&amp;gt;300
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Oct 2016 14:49:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-that-alerts-if-one-event-exists-and-another-does-not/m-p/275954#M83251</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-28T14:49:02Z</dc:date>
    </item>
  </channel>
</rss>

