<?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: Match One Without Another, with Delay in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690461#M235161</link>
    <description>&lt;P&gt;Thanks for the input, &lt;SPAN&gt;Giuseppe.&amp;nbsp;&lt;/SPAN&gt;I have not considered a max time between START and END events. I may need to think about that requirement.&lt;/P&gt;&lt;P&gt;I notice that you put&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;earliest==-15m AND latest==-5m&lt;/LI-CODE&gt;&lt;P&gt;at the start of the query. It seems to me that this would check whether both START and END events are &amp;gt; 5 minutes old, &amp;nbsp;which would be subject to the same issue I have today, in which the alert fires between&amp;nbsp;START and END events.&lt;/P&gt;&lt;P&gt;What I think I need is to find a START event &amp;gt; 5 minutes old, with a corresponding END event of any age.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 12:39:17 GMT</pubDate>
    <dc:creator>rdhdr</dc:creator>
    <dc:date>2024-06-12T12:39:17Z</dc:date>
    <item>
      <title>Match One Without Another, with Delay</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690455#M235159</link>
      <description>&lt;P&gt;Hello, I have programs which write status events to Splunk. At the beginning they write EVENT=START and at the end, they write EVENT=END, both with a matching UID. I have created an alert which monitors for a START event without a corresponding END event, in order to find when a program may terminate abruptly. The alert is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indxtst
| table _time source EVENT_TYPE EVENT_SUBTYPE UID EVENT
| eval stat=case(EVENT=="START","START",EVENT=="END","END")
| eventstats dc(stat) as dc_stat by UID
| search dc_stat=1 AND stat=START&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This alert works fine, except sometimes it catches it while the program is running and simply hasn't written an END event yet. To fix this, I would like to add a delay, but that is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indxtst 
| table _time source EVENT_TYPE EVENT_SUBTYPE UID EVENT
| eval stat=case(EVENT=="START","START",EVENT=="END","END")
| eventstats dc(stat) as dc_stat by UID
| search dc_stat=1 AND stat=START AND earliest==-15m AND latest==-5m&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This pulls back no records at all, even when appropriate testing data is created.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 11:26:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690455#M235159</guid>
      <dc:creator>rdhdr</dc:creator>
      <dc:date>2024-06-12T11:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Match One Without Another, with Delay</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690458#M235160</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/268952"&gt;@rdhdr&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;is there a wanted max time between the two events?&amp;nbsp;&lt;/P&gt;&lt;P&gt;if yes, I'd use this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indxtst earliest==-15m AND latest==-5m
| eval stat=case(EVENT=="START","START",EVENT=="END","END")
| stats 
     dc(stat) as dc_stat 
     earliest(eval(EVENT=="START")) AS earliest
     latest(eval(EVENT=="END")) AS latest
     values(source) AS source
     values(EVENT_TYPE) AS EVENT_TYPE
     values(EVENT_SUBTYPE) AS EVENT_SUBTYPE
     values(EVENT) AS EVENT
     by UID
| where (dc_stat=1 AND stat=START) OR latest-earliest&amp;gt;=600
| eval 
     earliest=straftime(earliest,"%Y-%m-%d %H:%M:%S"),
     latest=if(isnull(latest),"No END event",straftime(latest,"%Y-%m-%d %H:%M:%S"))
| stats table _time source EVENT_TYPE EVENT_SUBTYPE UID EVENT&lt;/LI-CODE&gt;&lt;P&gt;C iao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 12:05:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690458#M235160</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-06-12T12:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Match One Without Another, with Delay</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690461#M235161</link>
      <description>&lt;P&gt;Thanks for the input, &lt;SPAN&gt;Giuseppe.&amp;nbsp;&lt;/SPAN&gt;I have not considered a max time between START and END events. I may need to think about that requirement.&lt;/P&gt;&lt;P&gt;I notice that you put&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;earliest==-15m AND latest==-5m&lt;/LI-CODE&gt;&lt;P&gt;at the start of the query. It seems to me that this would check whether both START and END events are &amp;gt; 5 minutes old, &amp;nbsp;which would be subject to the same issue I have today, in which the alert fires between&amp;nbsp;START and END events.&lt;/P&gt;&lt;P&gt;What I think I need is to find a START event &amp;gt; 5 minutes old, with a corresponding END event of any age.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 12:39:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690461#M235161</guid>
      <dc:creator>rdhdr</dc:creator>
      <dc:date>2024-06-12T12:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Match One Without Another, with Delay</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690465#M235163</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/268952"&gt;@rdhdr&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;sorry, when I copied your conditions I forgot to use a larger time!&lt;/P&gt;&lt;P&gt;Anyway, let me know if I can help you more, or, please, accept one answer for the other people of Community.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 13:10:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690465#M235163</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-06-12T13:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Match One Without Another, with Delay</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690710#M235236</link>
      <description>&lt;P&gt;Hi, I guess the question I still need an answer to is, how can I apply a time restriction to the START event, but not the END event?&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 10:47:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690710#M235236</guid>
      <dc:creator>rdhdr</dc:creator>
      <dc:date>2024-06-14T10:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Match One Without Another, with Delay</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690727#M235245</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/268952"&gt;@rdhdr&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;sorry but I don't understand what you mean with "Time restrictions"&lt;/P&gt;&lt;P&gt;You have to define a time period for yout check in which you can have Start and End events.&lt;/P&gt;&lt;P&gt;Obviously you could have events started before where the Start Event isn't in the time frame, but it's an issue inside the Splunk approach: you must define the time period to execute your searches.&lt;/P&gt;&lt;P&gt;Eventually you could use a larger time period.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 13:11:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690727#M235245</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-06-14T13:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Match One Without Another, with Delay</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690752#M235254</link>
      <description>&lt;P&gt;This requirement was solved with the following syntax:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = indxtst 
| table _time source EVENT_TYPE EVENT_SUBTYPE UID EVENT
| eval diff=now()-_time
| eval type=case(EVENT=="START","START",EVENT="END","END")
| eventstats dc(type) as dc_type by UID
| search dc_type=1 AND (type=START AND diff&amp;gt;300)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Jun 2024 19:13:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690752#M235254</guid>
      <dc:creator>rdhdr</dc:creator>
      <dc:date>2024-06-14T19:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Match One Without Another, with Delay</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690771#M235265</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/268952"&gt;@rdhdr&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 23:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-One-Without-Another-with-Delay/m-p/690771#M235265</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-06-14T23:24:55Z</dc:date>
    </item>
  </channel>
</rss>

