<?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: Joining to another sourcetype based on field from one log message and correlating to a different log message in the same log in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Joining-to-another-sourcetype-based-on-field-from-one-log/m-p/110704#M28938</link>
    <description>&lt;P&gt;Thanks for the help, figured it out&lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2015 15:06:35 GMT</pubDate>
    <dc:creator>danoconnl</dc:creator>
    <dc:date>2015-05-14T15:06:35Z</dc:date>
    <item>
      <title>Joining to another sourcetype based on field from one log message and correlating to a different log message in the same log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-to-another-sourcetype-based-on-field-from-one-log/m-p/110702#M28936</link>
      <description>&lt;P&gt;log a&lt;BR /&gt;
5/14/2015 1pm [1150] &amp;lt;message&amp;gt;&amp;lt;trnid&amp;gt;1001&amp;lt;/trnid&amp;gt;&amp;lt;/message&amp;gt;&lt;BR /&gt;
5/14/2015 1:01pm [1150]elapsed time = 1100&lt;/P&gt;

&lt;P&gt;log b&lt;BR /&gt;
5/14/2015 1pm, trnid=1001, 1200&lt;/P&gt;

&lt;P&gt;so log a and b are linked on transaction id, and the two lines in log a are linked by the 1150.&lt;/P&gt;

&lt;P&gt;I've got code that will pull the trnid out of the message, I just don't know how to link the two together and then use it to compare the elapsed time in log a to the third number in log b&lt;/P&gt;

&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 12:45:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-to-another-sourcetype-based-on-field-from-one-log/m-p/110702#M28936</guid>
      <dc:creator>danoconnl</dc:creator>
      <dc:date>2015-05-14T12:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Joining to another sourcetype based on field from one log message and correlating to a different log message in the same log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-to-another-sourcetype-based-on-field-from-one-log/m-p/110703#M28937</link>
      <description>&lt;P&gt;Depending on what your end goal is you should use either of the following commands:&lt;BR /&gt;
 - &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Transaction"&gt;Transaction&lt;/A&gt;&lt;BR /&gt;
You'd have to transact on log a's ID, then transact with the trnid to log b. You'd end up with a single event with all three log lines aggregated, and all the fields from all three events would be available in your new aggregated event.&lt;/P&gt;

&lt;P&gt;Your search would look something like this:&lt;/P&gt;

&lt;P&gt;&amp;lt;base search for both log a and log b&amp;gt; | transaction &amp;lt;log a's id&amp;gt; keeporphans=true | transaction trnid&lt;/P&gt;

&lt;P&gt;Make sure to use as many parameters/attributes in each of the transaction commands, because transaction can be an expensive command. Look into things like maxspan, maxpause, startswith, etc&lt;/P&gt;

&lt;P&gt;OR&lt;BR /&gt;
- &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Join"&gt;Join&lt;/A&gt;&lt;BR /&gt;
Basically you'd have to treat every part as a database table and join them separately. You'd end up with all the fields from all the events under a single event, but you would not have all the _raw messages from each event. Also note that join uses subsearches; subsearches are not efficient and have a default 10k limit to resulting events.&lt;/P&gt;

&lt;P&gt;Your search would look something like this:&lt;/P&gt;

&lt;P&gt;&amp;lt;your base search for log a type 1 events &amp;gt; | join &amp;lt;log a's id&amp;gt; [search &amp;lt;your base search for log a type 2 events&amp;gt; | join trnid [search &amp;lt;base search for log b&amp;gt;&lt;/P&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;

&lt;P&gt;--- EDIT: fixed typos ---&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 13:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-to-another-sourcetype-based-on-field-from-one-log/m-p/110703#M28937</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2015-05-14T13:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Joining to another sourcetype based on field from one log message and correlating to a different log message in the same log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-to-another-sourcetype-based-on-field-from-one-log/m-p/110704#M28938</link>
      <description>&lt;P&gt;Thanks for the help, figured it out&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 15:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-to-another-sourcetype-based-on-field-from-one-log/m-p/110704#M28938</guid>
      <dc:creator>danoconnl</dc:creator>
      <dc:date>2015-05-14T15:06:35Z</dc:date>
    </item>
  </channel>
</rss>

