<?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: join two events with a common field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353460#M104629</link>
    <description>&lt;P&gt;Transaction won’t join per se, it groups events based on a common field. tid in this case. &lt;/P&gt;

&lt;P&gt;I have double checked my spl and I can’t see anything  wrong, so am intrigued what it actually outputs for you. &lt;/P&gt;</description>
    <pubDate>Wed, 20 Dec 2017 06:49:14 GMT</pubDate>
    <dc:creator>nickhills</dc:creator>
    <dc:date>2017-12-20T06:49:14Z</dc:date>
    <item>
      <title>join two events with a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353456#M104625</link>
      <description>&lt;P&gt;I want to join the below two events based on tid. For "Event1", there could be multiple" Event2"&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Event1:&lt;/STRONG&gt;&lt;BR /&gt;
&lt;CODE&gt;20171219.114132  myapp error  statusCode=500 tid=14ec038e-ba3d-423d-836a-1c7b8fa3073d&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Event2:&lt;/STRONG&gt;&lt;BR /&gt;
&lt;CODE&gt;20171219.114132  Fn=makeRequest  HttpStatusCode=401 ElapsedTime=79  tid=14ec038e-ba3d-423d-836a-1c7b8fa3073d&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;20171219.114132  Fn=makeRequest  HttpStatusCode=200 ElapsedTime=50  tid=14ec038e-ba3d-423d-836a-1c7b8fa3073d&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I have tried this so far but it doesn't give all the events - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex "myapp error"  |join tid [search  index=myindex Fn=makeRequest |fields tid, HttpStatusCode] |table tid, statusCode, HttpStatusCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Dec 2017 21:32:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353456#M104625</guid>
      <dc:creator>pankajad</dc:creator>
      <dc:date>2017-12-19T21:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: join two events with a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353457#M104626</link>
      <description>&lt;P&gt;would transaction not be of use here?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex ("myapp error" OR Fn=makeRequest)  |transaction tid startswith="myapp error"|table tid, statusCode, HttpStatusCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Dec 2017 22:01:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353457#M104626</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2017-12-19T22:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: join two events with a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353458#M104627</link>
      <description>&lt;P&gt;This didn't work. I'm getting all events from "Fn=makeRequest "and "myapp error". It's not doing any join&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 00:30:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353458#M104627</guid>
      <dc:creator>pankajad</dc:creator>
      <dc:date>2017-12-20T00:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: join two events with a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353459#M104628</link>
      <description>&lt;P&gt;Hi @pankajad,&lt;/P&gt;

&lt;P&gt;Can you please try search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex "myapp error" 
| append 
    [ search index=myindex Fn=makeRequest 
    | fields tid, HttpStatusCode] 
| stats values(statusCode) as statusCode values(HttpStatusCode) as HttpStatusCode by tid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check my sample search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="20171219.114132 myapp error statusCode=500 tid=14ec038e-ba3d-423d-836a-1c7b8fa3073d" 
| append 
    [| makeresults 
    | eval _raw="20171219.114132 Fn=makeRequest HttpStatusCode=401 ElapsedTime=79 tid=14ec038e-ba3d-423d-836a-1c7b8fa3073d"] 
| append 
    [| makeresults 
    | eval _raw="20171219.114132 Fn=makeRequest HttpStatusCode=200 ElapsedTime=50 tid=14ec038e-ba3d-423d-836a-1c7b8fa3073d"] 
| kv
| stats values(statusCode) as statusCode values(HttpStatusCode) as HttpStatusCode by tid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 04:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353459#M104628</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-12-20T04:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: join two events with a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353460#M104629</link>
      <description>&lt;P&gt;Transaction won’t join per se, it groups events based on a common field. tid in this case. &lt;/P&gt;

&lt;P&gt;I have double checked my spl and I can’t see anything  wrong, so am intrigued what it actually outputs for you. &lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 06:49:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353460#M104629</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2017-12-20T06:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: join two events with a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353461#M104630</link>
      <description>&lt;P&gt;I made a slight change to the suggestion above, could you try it again?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2017 09:46:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-events-with-a-common-field/m-p/353461#M104630</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2017-12-21T09:46:30Z</dc:date>
    </item>
  </channel>
</rss>

