<?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: Finding events immediately following/preceding another event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-immediately-following-preceding-another-event/m-p/640684#M221977</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/256020"&gt;@AjayTakur&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the question is bit confusion, but, nevertheless, basically you need Splunk's transaction command:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/SearchReference/Transaction#Basic_Examples" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/SearchReference/Transaction#Basic_Examples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very basic rough draft SPL:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=a source=b sourcetype=c 
| transaction MIT startswith=" step started" endswith=" step completed" maxspan=2s&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Apr 2023 19:26:38 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2023-04-19T19:26:38Z</dc:date>
    <item>
      <title>How to find events immediately following/preceding another event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-immediately-following-preceding-another-event/m-p/640677#M221973</link>
      <description>&lt;P&gt;I have to search for events&lt;/P&gt;
&lt;P&gt;I have one event let's say MIT=" step started"&lt;BR /&gt;and another event says MIT=" step completed"&lt;/P&gt;
&lt;P&gt;Now I have to ensure that both events have been included in my search criteria&lt;BR /&gt;in such a way that&lt;/P&gt;
&lt;P&gt;Case 1:The first event is started the&amp;nbsp;second event will get completed.&lt;/P&gt;
&lt;P&gt;Case 2: If the first event is not started then the second event will also not be complete.&lt;BR /&gt;Considering these conditions I need search criteria.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 18:13:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-immediately-following-preceding-another-event/m-p/640677#M221973</guid>
      <dc:creator>AjayTakur</dc:creator>
      <dc:date>2023-04-21T18:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Finding events immediately following/preceding another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-immediately-following-preceding-another-event/m-p/640684#M221977</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/256020"&gt;@AjayTakur&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the question is bit confusion, but, nevertheless, basically you need Splunk's transaction command:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/SearchReference/Transaction#Basic_Examples" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/SearchReference/Transaction#Basic_Examples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very basic rough draft SPL:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=a source=b sourcetype=c 
| transaction MIT startswith=" step started" endswith=" step completed" maxspan=2s&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 19:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-immediately-following-preceding-another-event/m-p/640684#M221977</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2023-04-19T19:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Finding events immediately following/preceding another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-immediately-following-preceding-another-event/m-p/640875#M222040</link>
      <description>&lt;P&gt;for two different events ie., started and successful the successful might not be an event happening after started then, in this case, is this search criteria correct?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;index=a source=b | transaction startswith=MIT="Local Step started." endswith=MIT="Copy step successful." keepevicted=true | search closed_txn=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 17:20:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-immediately-following-preceding-another-event/m-p/640875#M222040</guid>
      <dc:creator>AjayTakur</dc:creator>
      <dc:date>2023-04-20T17:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Finding events immediately following/preceding another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-immediately-following-preceding-another-event/m-p/640928#M222074</link>
      <description>&lt;P&gt;Never use the "transaction" command for production.&amp;nbsp; Try this:&lt;/P&gt;&lt;P&gt;index="YourIndexHere" AND sourcetype="YourSourcetypeHere" AND MIT IN("step started", step completed")&lt;BR /&gt;| stremstats count(eval(MIT="stepstarted")) AS SessionID BY host ```And maybe other fields here```&lt;BR /&gt;| stats min(_time) AS _time range(_time) AS duration dc(MIT) AS MITcount values(MIT) AS MIT BY host ``And maybe other fields here```&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 23:29:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-immediately-following-preceding-another-event/m-p/640928#M222074</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2023-04-20T23:29:41Z</dc:date>
    </item>
  </channel>
</rss>

