<?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 3 different data sources in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242979#M72297</link>
    <description>&lt;P&gt;this may point you in the right direction&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://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>Wed, 16 Mar 2016 12:48:01 GMT</pubDate>
    <dc:creator>asimagu</dc:creator>
    <dc:date>2016-03-16T12:48:01Z</dc:date>
    <item>
      <title>how to join 3 different data sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242978#M72296</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have 3 different sources. I want to merge splunk search data with another data of 2 different csv files using inputlookup.&lt;/P&gt;

&lt;P&gt;From all 3 different sources p_name is the common field. But csv files having more number of records (this file is having duplicate project names) than IVW logs. I want to lookup with csv file for latest values.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;P&gt;from IVW logs, I got output like&lt;/P&gt;

&lt;P&gt;p_name;         respondents;            host&lt;BR /&gt;
A                        20                               X&lt;BR /&gt;
B                         25                              Y&lt;BR /&gt;
C                          5                                Z&lt;BR /&gt;
D                         12                               W&lt;BR /&gt;
E                           6                                 V&lt;/P&gt;

&lt;P&gt;From A-N.csv, I have fileds like&lt;/P&gt;

&lt;P&gt;p_code;     O_Status;         O_Server;               Contact;                       SVer                        DateTime&lt;BR /&gt;
A;                    Pass;               AB1;                        abc@f ;                         2;                               23/01/2016 06:30:20&lt;BR /&gt;&lt;BR /&gt;
A;                    Pass;               AB1;                        abc@f ;                         2;                               22/02/2016 05:10:20 &lt;BR /&gt;
A;                    fail;                 AB1;                          abc@f ;                        2;                               13/03/2016 08:30:20 &lt;BR /&gt;
A;                    Pass;               AB1;                        abc@f ;                         2;                               05/03/2016 07:20:20 &lt;BR /&gt;
A;                    Pass;               AB1;                        abc@f ;                         2;                               06/03/2016 05:30:20&lt;BR /&gt;
A;                    Pass;               AB1;                        abc@f ;                         2;                               11/03/2016 05:30:20&lt;BR /&gt;
C;                    fail;                 NA                           Not found                    NA                             15/01/2016 05:30:20&lt;BR /&gt;
C;                    Pass;               AB1;                        abc@f ;                         2;                               05/02/2016 05:30:20&lt;BR /&gt;
C;                    Pass;               AB1;                        abc@f ;                         2;                               15/02/2016 05:30:20&lt;BR /&gt;
C;                    fail;                 AB1;                        abc@f ;                         2;                               02/03/2016 05:30:20&lt;BR /&gt;
C;                    fail;                 AB1;                        abc@f ;                         2;                               13/03/2016 05:30:20&lt;BR /&gt;
B;                    Pass;               AB1;                        abc@f ;                         2;                               12/01/2016 05:30:20&lt;BR /&gt;
B;                    Pass;               AB1;                        abc@f ;                         2;                               11/02/2016 05:30:20&lt;BR /&gt;
B;                    Pass;               AB1;                        abc@f ;                         2;                               10/02/2016 05:30:20&lt;BR /&gt;
B;                    Pass;               AB1;                        abc@f ;                         2;                               25/02/2016 05:30:20&lt;BR /&gt;
B;                    Pass;               AB1;                        abc@f ;                         2;                               02/03/2016 05:30:20&lt;BR /&gt;
B;                    Pass;               AB1;                        abc@f ;                         2;                               07/03/2016 05:30:20&lt;BR /&gt;
B;                    pass;                  AB1;                        abc@f ;                         2;                               12/03/2016 05:30:20&lt;BR /&gt;
H;                    Pass;               AB1;                        abc@f ;                         2;                               10/02/2016 05:30:20&lt;BR /&gt;
H;                    Pass;               AB1;                        abc@f ;                         2;                               25/02/2016 05:30:20&lt;BR /&gt;
H;                    Pass;               AB1;                        abc@f ;                         2;                               02/03/2016 05:30:20&lt;BR /&gt;
H;                    Pass;               AB1;                        abc@f ;                         2;                               07/03/2016 05:30:20&lt;BR /&gt;
M;                    fail;                  AB1;                        abc@f ;                         2;                               12/03/2016 05:30:20&lt;BR /&gt;
M;                    Pass;               AB1;                        abc@f ;                         2;                               02/03/2016 05:30:20&lt;BR /&gt;
M;                    Pass;               AB1;                        abc@f ;                         2;                               07/03/2016 05:30:20&lt;BR /&gt;
M;                    fail;                  AB1;                        abc@f ;                         2;                               12/03/2016 05:30:20&lt;BR /&gt;
M;                    Pass;               AB1;                        abc@f ;                         2;                               10/02/2016 05:30:20&lt;/P&gt;

&lt;P&gt;From D1.csv, I have fields like&lt;/P&gt;

&lt;P&gt;Project;             CCoun;                     CO1;                              Contacts&lt;BR /&gt;&lt;BR /&gt;
A;                        ABC ;                          AB ;                                  AB@g&lt;BR /&gt;
B;                         XYZ ;                         CD  ;                                 BC@g&lt;BR /&gt;&lt;BR /&gt;
C;                         LMN ;                        EF   ;                                 CD@g&lt;BR /&gt;
D;                         PQR ;                        GH ;                                 EF@g&lt;BR /&gt;
E;                          STU ;                        YZ   ;                                 GH@g&lt;/P&gt;

&lt;P&gt;I want my output like&lt;/P&gt;

&lt;P&gt;p_name;         respondents;            host;                  CCoun;                  CO1;               Contancts;               O_status       O_Server        SVer&lt;BR /&gt;&lt;BR /&gt;
A ;                        20 ;                             X;                      ABC ;                     AB ;                   AB@g ;                       Pass ;           AB1                  2&lt;BR /&gt;
B ;                        25 ;                             Y                        XYZ;                      CD ;                   BC@g ;                       pass ;           AB1                 2&lt;BR /&gt;&lt;BR /&gt;
C ;                         5  ;                             Z                       LMN ;                     EF ;                    CD@g                        fail ;              AB1                 2 &lt;BR /&gt;
D ;                        12 ;                            W                       PQR ;                     GH;                   EF@g&lt;BR /&gt;&lt;BR /&gt;
E  ;                         6  ;                            V                        STU ;                      YZ ;                   GH@g                        &lt;/P&gt;

&lt;P&gt;Below query is giving results but in some places there is data in A-N.csv but not showing in output. Can any one help me to do this.&lt;/P&gt;

&lt;P&gt;there is duplicate project names in A-N.csv, but when I am mapping with ivw data it has to show latest values based on the date in         A-N.csv &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index=ibm sourcetype=ivw host=ABC |eval p_name=upper(p_name) |chart  distinct_count(respondentID) as respondents,  values(host) as "host", count as Entries, |join max=0 type=outer "p_name" [|inputlookup A-N.csv |rename PCode as p_name|values(O_Server) as O_Server values(O_Status) as O_Status values(SVer) as SVer by p_name] |join max=0 type=outer "p_name" [|inputlookup D1.csv |rename project as p_name|stats values(CCoun) as CCoun values(CO1) as CO1 values(Contacts) as Contacts by p_name ]&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:03:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242978#M72296</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2020-09-29T09:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to join 3 different data sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242979#M72297</link>
      <description>&lt;P&gt;this may point you in the right direction&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://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>Wed, 16 Mar 2016 12:48:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242979#M72297</guid>
      <dc:creator>asimagu</dc:creator>
      <dc:date>2016-03-16T12:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to join 3 different data sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242980#M72298</link>
      <description>&lt;P&gt;Thank you for your immediate response.&lt;/P&gt;

&lt;P&gt;I tried this but no luck. Here I am mapping values with csv &lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2016 13:07:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242980#M72298</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2016-03-16T13:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to join 3 different data sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242981#M72299</link>
      <description>&lt;P&gt;Looks like you've csv fiels ingested as lookup  table files, so you don't need join at all. It could be as simple as this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ibm sourcetype=ivw host=ABC |eval p_name=upper(p_name) |chart distinct_count(respondentID) as respondents, values(host) as "host", count as Entries, 
| lookup A-N.csv PCode as p_name OUTPUT O_Server OStatus Sver 
| lookup D1.csv project as p_name OUTPUT CCount CO1 Contacts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ibm sourcetype=ivw host=ABC |eval p_name=upper(p_name) |chart distinct_count(respondentID) as respondents, values(host) as "host", count as Entries by p_name
| lookup D1.csv project as p_name OUTPUT CCount CO1 Contacts
| append [| inputlookup A-N.csv | rename PCode as p_name | sort 0 p_name -DateTime | dedup p_name | table p_name O_Server OStatus Sver ]
| stats values(*) as * by p_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Mar 2016 14:05:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242981#M72299</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-16T14:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to join 3 different data sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242982#M72300</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;When I used this query I am getting all values from A-N.csv but I don't want all values from A-N.csv for one project I want to display only latest value from the A-N.csv. &lt;/P&gt;

&lt;P&gt;Means from my sample data If Project A is having more than one OStatus but I want only OStatus of latest. If Ostatus for A is having fail on 15/Feb/2016 but on 16/Mar/2016  the project status was Pass I want to display only this pass in my output not all values from A-N.csv&lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2016 14:36:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242982#M72300</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2016-03-16T14:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to join 3 different data sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242983#M72301</link>
      <description>&lt;P&gt;Thank you so much the update one worked for me&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2016 17:31:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-join-3-different-data-sources/m-p/242983#M72301</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2016-03-16T17:31:58Z</dc:date>
    </item>
  </channel>
</rss>

