<?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 events based on one common value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274285#M82746</link>
    <description>&lt;P&gt;Try this.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Xyseries"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Xyseries&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2019 05:57:47 GMT</pubDate>
    <dc:creator>riqbal47010</dc:creator>
    <dc:date>2019-11-21T05:57:47Z</dc:date>
    <item>
      <title>How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274277#M82738</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have two different events of data :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Event 1 = mail :
id_mail : 1
title_mail : test
mail_srv : host1

Event 2 = server:
id_srv : 3
srv_name : host1
srv_ip : 192.168.0.1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to print Event 1 (mail) data with a column containing the server IP like this :  id_mail,  title_mail,  mail_srv,   srv_ip&lt;/P&gt;

&lt;P&gt;How can I do this?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:42:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274277#M82738</guid>
      <dc:creator>Naaba</dc:creator>
      <dc:date>2020-09-29T12:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274278#M82739</link>
      <description>&lt;P&gt;There need to be a common field between those two type of events. If that common field (in terms of matching values) is mail_srv/srv_name, then try like this&lt;/P&gt;

&lt;P&gt;your base search fetching both type of events&lt;BR /&gt;
| eval host_name=coalesce(mail_srv,srv_name)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:39:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274278#M82739</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T12:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274279#M82740</link>
      <description>&lt;P&gt;Thank you for your answer but It doesn't give the result i want.&lt;BR /&gt;
I want to be able to use the fields the two events :&lt;/P&gt;

&lt;P&gt;Event 1 = mail :&lt;BR /&gt;
id_mail : 1&lt;BR /&gt;
title_mail : test&lt;BR /&gt;
mail_srv : host1&lt;/P&gt;

&lt;P&gt;Event 2 = server:&lt;BR /&gt;
id_srv : 3&lt;BR /&gt;
srv_name : host1&lt;BR /&gt;
srv_ip : 192.168.0.1&lt;/P&gt;

&lt;P&gt;I want to be able to print a table like this :&lt;BR /&gt;
id_mail, title_mail, host1,id_srv ,srv_name ,srv_ip &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:42:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274279#M82740</guid>
      <dc:creator>Naaba</dc:creator>
      <dc:date>2020-09-29T12:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274280#M82741</link>
      <description>&lt;P&gt;Didn't realize the query was incompletely posted. Here is the full query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search fetching both type of events
| eval host_name=coalesce(mail_srv,srv_name)
| stats values(id_mail) as id_mail, values(title_mail) as title_mail ,values(id_srv) as id_srv, values(srv_ip) as srv_ip by host_name 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 16:56:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274280#M82741</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-02T16:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274281#M82742</link>
      <description>&lt;P&gt;There is almost certainly a better way to do this, but I think this will work based on the information that you have given&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A sourcetype=mail
| join type=outer mail_srv [ search index=B sourcetype=server | dedup srv_name | rename srv_name as mail_srv ]
| table id_mail, title_mail, mail_srv, srv_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 17:20:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274281#M82742</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-02-02T17:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274282#M82743</link>
      <description>&lt;P&gt;the usage of "coalesce" is brilliant... I would've suggested "join"&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 18:24:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274282#M82743</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2017-02-02T18:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274283#M82744</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Search Here To Get Both Types Of Events | eval srv_ip=coalesce(srv_ip, mail_srv) | stats min(_time) AS _time values(*) AS * BY srv_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Mar 2017 21:55:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274283#M82744</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-01T21:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274284#M82745</link>
      <description>&lt;P&gt;whats about xyseries command. which convert coloms to rows.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Xyseries"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Xyseries&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 05:57:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274284#M82745</guid>
      <dc:creator>riqbal47010</dc:creator>
      <dc:date>2019-11-21T05:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274285#M82746</link>
      <description>&lt;P&gt;Try this.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Xyseries"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Xyseries&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 05:57:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274285#M82746</guid>
      <dc:creator>riqbal47010</dc:creator>
      <dc:date>2019-11-21T05:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two events based on one common value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274286#M82747</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval srv_name = coalesce(mail_srv,srv_name)
| fields id_mail title_mail id_srv srv_name srv_ip
| stats values(*) AS * BY srv_name
| table id_mail title_mail id_srv srv_name srv_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Nov 2019 15:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-events-based-on-one-common-value/m-p/274286#M82747</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-21T15:35:37Z</dc:date>
    </item>
  </channel>
</rss>

