<?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 to join two search events that have a common field without using Join? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159605#M45054</link>
    <description>&lt;P&gt;The flaw here being there is no guarantee each nth sub search result corresponds to the nth main search result.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Dec 2014 13:15:37 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2014-12-19T13:15:37Z</dc:date>
    <item>
      <title>How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159595#M45044</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am looking for options to use to join two searches which has a common field.  I have already tried the JOIN command which has more performance impact. Below is the query that I use now.&lt;/P&gt;

&lt;P&gt;Search A returns the field TxnId and Queue&lt;BR /&gt;
Search B returns the minimum and maximum times&lt;/P&gt;

&lt;P&gt;Search A | fields TxnId,Queue | join TxnId [ search B or C | stats min(_time) as start_time, max(_time) as end_time by TxnId | eval total_time = end_time - start_time] | table total_time,Queue&lt;/P&gt;

&lt;P&gt;Search A returns an average of 600+ events but the join takes more than 60 seconds to return the results.&lt;BR /&gt;
Is there any other methods or commands which i can use to join these two searches?&lt;/P&gt;

&lt;P&gt;Thanks in Advance&lt;/P&gt;

&lt;P&gt;Regards&lt;BR /&gt;
Murali&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:27:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159595#M45044</guid>
      <dc:creator>Murali2888_bad</dc:creator>
      <dc:date>2020-09-28T18:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159596#M45045</link>
      <description>&lt;P&gt;A minor update to the Question. The Field TxnId is the common field between the two search events&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 01:37:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159596#M45045</guid>
      <dc:creator>Murali2888_bad</dc:creator>
      <dc:date>2014-12-16T01:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159597#M45046</link>
      <description>&lt;P&gt;I'm not sure what it'll do in terms of performance, but how about:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search A&amp;gt; | fields TxnId,Queue | dedup TxnId | append [search &amp;lt;search B or C&amp;gt; | stats min(_time) as start_time max(_time) as end_time by TxnId | eval total_time = end_time - start_time | fields TxnId, total_time] | stats first(*) by TxnId | table total_time,Queue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Based on your comment, if search A is relatively fast, then we can do a subsearch to qualify with only those TxnIds in : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;search A&amp;gt; | fields TxnId,Queue | dedup TxnId | append [search &amp;lt;search B or C&amp;gt; [&amp;lt;search A&amp;gt; | fields TxnId | dedup TxnId]  | stats min(_time) as start_time max(_time) as end_time by TxnId | eval total_time = end_time - start_time | fields TxnId, total_time] | stats first(*) by TxnId | table total_time,Queue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Dec 2014 02:00:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159597#M45046</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2014-12-16T02:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159598#M45047</link>
      <description>&lt;P&gt;Hi @Murali2888&lt;/P&gt;

&lt;P&gt;This post might be helpful for your case &lt;A href="http://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;http://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 02:01:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159598#M45047</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2014-12-16T02:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159599#M45048</link>
      <description>&lt;P&gt;Hi @acharlieh,&lt;/P&gt;

&lt;P&gt;I need to pass the TxnId to the subsequent search to retrieve the results. Hence using append would not be better option.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 22:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159599#M45048</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2014-12-16T22:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159600#M45049</link>
      <description>&lt;P&gt;@Murali2888 can you describe more about the subsequent search? Why do you need to provide TxnId?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 22:48:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159600#M45049</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2014-12-16T22:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159601#M45050</link>
      <description>&lt;P&gt;Hi @acharlieh,&lt;/P&gt;

&lt;P&gt;Let me explain the the data setup I have now.&lt;BR /&gt;
Our data is configured in a way that a single TxnId is common across a set of events (say 6 or 7 events).&lt;BR /&gt;
In this case, I am retrieving the TxnIds which are matching the Search A criteria. &lt;BR /&gt;
I need to perform the Search B or C only on those TxnIds returned by Search A.&lt;/P&gt;

&lt;P&gt;And post that, I need to combine all the output fields (one field from Search A and one field from Search B or C) and display the results together.&lt;/P&gt;

&lt;P&gt;I am sorry, unfortunately I will not be able to provide the exact data as this is confidential.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Murali&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 23:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159601#M45050</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2014-12-16T23:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159602#M45051</link>
      <description>&lt;P&gt;So you want the TxnId,Queue for those in Search A... and the min(_time) and max(_time) for those that match  whose TxnId is retrieved by ...&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159602#M45051</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2020-09-28T18:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159603#M45052</link>
      <description>&lt;P&gt;Yes acharlieh.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2014 01:02:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159603#M45052</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2014-12-17T01:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159604#M45053</link>
      <description>&lt;P&gt;try this:&lt;BR /&gt;
      "search A"|dedup Txnld |appendcols [search B or C | stats min(_time) as start_time, max(_time) as end_time by TxnId | eval total_time = end_time - start_time] | table total_time,Queue&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159604#M45053</guid>
      <dc:creator>tachifelix</dc:creator>
      <dc:date>2020-09-28T18:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159605#M45054</link>
      <description>&lt;P&gt;The flaw here being there is no guarantee each nth sub search result corresponds to the nth main search result.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2014 13:15:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159605#M45054</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2014-12-19T13:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159606#M45055</link>
      <description>&lt;P&gt;If the B or C are always before or after A, then this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;A OR B OR C | stats values(Queue) as Queue range(_time) as duration by TxnId
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Should do the trick. If it's essential that it's only the times from B or C you can do this with an eval&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;A OR B OR C | stats values(Queue) as Queue range(eval(if(searchmatch("B OR C"), _time, null()))) as duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Additionally you can add on other stats like &lt;CODE&gt;earliest(_time)&lt;/CODE&gt; or &lt;CODE&gt;latest(_time)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2014 14:52:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159606#M45055</guid>
      <dc:creator>dturnbull_splun</dc:creator>
      <dc:date>2014-12-19T14:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159607#M45056</link>
      <description>&lt;P&gt;try with transaction command&lt;BR /&gt;
for exple:&lt;BR /&gt;
search  A OR B OR C | transaction  TxnId| eval total_time = duration | table total_time,Queue&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:34:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159607#M45056</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2020-09-28T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two search events that have a common field without using Join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159608#M45057</link>
      <description>&lt;P&gt;Thanks dturnbull_splunk. By far this is the most efficient query &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2015 04:55:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-events-that-have-a-common-field-without/m-p/159608#M45057</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2015-06-11T04:55:49Z</dc:date>
    </item>
  </channel>
</rss>

