<?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: How do you find consecutive events in two different searches? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401423#M116200</link>
    <description>&lt;P&gt;You can use the &lt;CODE&gt;startswith&lt;/CODE&gt; and &lt;CODE&gt;endswith&lt;/CODE&gt; option as well.&lt;BR /&gt;
So your transaction command should look something like &lt;CODE&gt;|transaction maxspan=5s startswith="some str 1" endswith = "some str 2"&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jan 2019 04:59:01 GMT</pubDate>
    <dc:creator>bangalorep</dc:creator>
    <dc:date>2019-01-11T04:59:01Z</dc:date>
    <item>
      <title>How do you find consecutive events in two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401420#M116197</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;This is a newbie question.&lt;/P&gt;

&lt;P&gt;I have two different searches. I want to combine the search results and only display a result where a certain event appears before another result.&lt;/P&gt;

&lt;P&gt;For e.g.&lt;/P&gt;

&lt;P&gt;Search1 : sourcetype=SourceType_A "Some str 1"&lt;BR /&gt;
Search2 : sourcetype=SourceType_B "Some str 2"&lt;/P&gt;

&lt;P&gt;Result set should be:&lt;BR /&gt;
Some str 2 &lt;BR /&gt;
Some str 1&lt;/P&gt;

&lt;P&gt;So I want to show only those instances where "Some str 1" is followed by "Some str 2" and time gap in within say 3 secs.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:44:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401420#M116197</guid>
      <dc:creator>funnysage</dc:creator>
      <dc:date>2020-09-29T22:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find consecutive events in two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401421#M116198</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
You can use the transaction command. &lt;BR /&gt;
So essentially a search like &lt;CODE&gt;(sourcetype=SourceType_A "Some str 1") OR (sourcetype=SourceType_B "Some str 2")&lt;/CODE&gt; will get the events in the same search. &lt;BR /&gt;
You can then use the &lt;CODE&gt;transaction&lt;/CODE&gt; command based on whats common among the events and use the &lt;CODE&gt;maxspan&lt;/CODE&gt; option to specify the time gap you want.&lt;BR /&gt;
Here is the documentation for the transaction command &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.3/SearchReference/Transaction"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.3/SearchReference/Transaction&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 09:33:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401421#M116198</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2019-01-10T09:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find consecutive events in two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401422#M116199</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;

&lt;P&gt;Thanks for the feedback.&lt;BR /&gt;
I used this criteria: &lt;CODE&gt;(sourcetype=SourceType_A "Some str 1") OR (sourcetype=SourceType_B "Some str 2")|transaction maxspan=5s&lt;/CODE&gt;.&lt;BR /&gt;
Using this i was able to group together the series of events that i was interested in. However, i am getting some extra events. My output looks something like this:&lt;/P&gt;

&lt;P&gt;"Some str 1"&lt;BR /&gt;
"Some str 1"&lt;BR /&gt;
&lt;STRONG&gt;"Some str 1" &amp;lt;- event group that i am interested. I wanted this group as the output.&lt;BR /&gt;
"Some str 2"&lt;/STRONG&gt;&lt;BR /&gt;
"Some str 1"&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 23:02:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401422#M116199</guid>
      <dc:creator>funnysage</dc:creator>
      <dc:date>2019-01-10T23:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find consecutive events in two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401423#M116200</link>
      <description>&lt;P&gt;You can use the &lt;CODE&gt;startswith&lt;/CODE&gt; and &lt;CODE&gt;endswith&lt;/CODE&gt; option as well.&lt;BR /&gt;
So your transaction command should look something like &lt;CODE&gt;|transaction maxspan=5s startswith="some str 1" endswith = "some str 2"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 04:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401423#M116200</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2019-01-11T04:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find consecutive events in two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401424#M116201</link>
      <description>&lt;P&gt;Check out below thread. I had similar query resolved using transaction command&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/714361/how-do-you-group-start-and-end-times-from-a-set-of.html"&gt;https://answers.splunk.com/answers/714361/how-do-you-group-start-and-end-times-from-a-set-of.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 05:54:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401424#M116201</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-01-11T05:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find consecutive events in two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401425#M116202</link>
      <description>&lt;P&gt;This works perfectly. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 06:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-consecutive-events-in-two-different-searches/m-p/401425#M116202</guid>
      <dc:creator>funnysage</dc:creator>
      <dc:date>2019-01-11T06:04:29Z</dc:date>
    </item>
  </channel>
</rss>

