<?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 source based on content of fields present in other fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189813#M54670</link>
    <description>&lt;P&gt;Can you please share the sample csv data for both the tables?&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2015 12:06:17 GMT</pubDate>
    <dc:creator>vganjare</dc:creator>
    <dc:date>2015-05-18T12:06:17Z</dc:date>
    <item>
      <title>Join Two source based on content of fields present in other fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189812#M54669</link>
      <description>&lt;P&gt;Hi, I have BIG URGENT CASE  here, and I'll appreciate your great help.&lt;/P&gt;

&lt;P&gt;Here it is, I need this type of (SQL) query to be "translated" in Splunk since the sources are .csv files (extract of sql tables originally).&lt;/P&gt;

&lt;P&gt;select &lt;BR /&gt;
         t1.col1, t1.col2, t2.cl1, t2.cl2 &lt;BR /&gt;
``from &lt;BR /&gt;
            ( select col1,col2,col3,col4 from tab1 ) as t1&lt;BR /&gt;
right join&lt;BR /&gt;
            ( select cl1,cl2,cl3,cl4 from tab2 ) as t2&lt;BR /&gt;
on t1.col3 like concat('%',t2.cl3.'%') &lt;BR /&gt;
      and t1.col4 like concat('%',t2.cl4.'%')&lt;BR /&gt;
;&lt;/P&gt;

&lt;P&gt;The thing is that I absolutely have nothing like "on col3=cl3" so that I have to dig to find if the value of col3 IS IN the string chain of the cl3.&lt;/P&gt;

&lt;P&gt;I hope someone will be able to get the point and help me.&lt;BR /&gt;
(oh, by the way, I tried, "append" and "join" but probably the wrong way (since the result went totally wrong)&lt;/P&gt;

&lt;P&gt;Thank you for your great help.&lt;BR /&gt;
B.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 12:00:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189812#M54669</guid>
      <dc:creator>bladeboxe</dc:creator>
      <dc:date>2015-05-18T12:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Join Two source based on content of fields present in other fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189813#M54670</link>
      <description>&lt;P&gt;Can you please share the sample csv data for both the tables?&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 12:06:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189813#M54670</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-18T12:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Join Two source based on content of fields present in other fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189814#M54671</link>
      <description>&lt;P&gt;Hi, I'll try the following example to explain what is wanted&lt;/P&gt;

&lt;P&gt;TAB 1 : Collaborateurs&lt;/P&gt;

&lt;P&gt;lastname,   name,   service tag,    birthday&lt;BR /&gt;
Rosenberg,  Joseph, REF4A,  25/05/1982&lt;BR /&gt;
Attali, Dan,    REF4A,  18/07/1981&lt;BR /&gt;
Salcherd,   David,  REF4B,  12/01/1959&lt;BR /&gt;
Sherman,    Gad,    REF4C,  07/07/1974&lt;/P&gt;

&lt;P&gt;TAB 2: Training's Catalogue&lt;/P&gt;

&lt;P&gt;training,   price,  services, concerned&lt;BR /&gt;
communication,  1024€,    Only REF4A&lt;BR /&gt;
security,   1344€,    REF4A and REF4B are concerned&lt;BR /&gt;
managment,  2745€,    REF4C&lt;/P&gt;

&lt;P&gt;Result expected: Skills and costs per collaborator&lt;/P&gt;

&lt;P&gt;lastname,   name,   training,   price&lt;BR /&gt;
Rosenberg,  Joseph, communication,  1024€&lt;BR /&gt;
Rosenberg,  Joseph, security,   1344€&lt;BR /&gt;
Attali, Dan,    communication,  1024€&lt;BR /&gt;
Attali, Dan,    security,   1344€&lt;BR /&gt;
Salcherd,   David,  security,   1344€&lt;BR /&gt;
Sherman,    Gad,    managment,  2745€&lt;/P&gt;

&lt;P&gt;I need that for each line of TAB 1, TAB 2 to be parsed line per line until we get the keyword from "service tag" (of tab1) into the chain in column "services concerned" (of tab2).&lt;/P&gt;

&lt;P&gt;Thank you&lt;BR /&gt;
B.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 13:58:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189814#M54671</guid>
      <dc:creator>bladeboxe</dc:creator>
      <dc:date>2015-05-18T13:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Join Two source based on content of fields present in other fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189815#M54672</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You can TAB1 &amp;amp; TAB2 information seperately. Once loaded, then you can try correlating the information together. I have stroed the information in following format:&lt;BR /&gt;
&lt;STRONG&gt;Data.csv&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;lastname, name, service_tag, birthday
Rosenberg, Joseph, REF4A, 25/05/1982
Attali, Dan, REF4A, 18/07/1981
Salcherd, David, REF4B, 12/01/1959
Sherman, Gad, REF4C, 07/07/1974
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Data1.csv&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;raining, price, services_concerned
communication, 1024€, REF4A
security, 1344€, REF4A:REF4B
managment, 2745€, REF4C
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please note: multiple services_concerned are represent as &lt;STRONG&gt;:&lt;/STRONG&gt; (colon) seperated values.&lt;/P&gt;

&lt;P&gt;Then, using following query, I was able to establish the relation.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup Data.csv | join max=0 service_tag [|inputlookup Data1.csv | eval services_concerned=split(services_concerned,":") | mvexpand services_concerned | rename services_concerned as service_tag]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the output generated:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;birthday    lastname    name    price   raining service_tag
25/05/1982   Rosenberg   Joseph  1024€     communication   REF4A
25/05/1982   Rosenberg   Joseph  1344€     security    REF4A
18/07/1981   Attali  Dan     1024€     communication   REF4A
18/07/1981   Attali  Dan     1344€     security    REF4A
12/01/1959   Salcherd    David   1344€     security    REF4B
07/07/1974   Sherman     Gad     2745€     managment   REF4C
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 10:26:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189815#M54672</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-19T10:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Join Two source based on content of fields present in other fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189816#M54673</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thank you already for you great he.&lt;BR /&gt;
But the thing is that I have to join on multiple set of columns (like content of file1.col1 to be found in file2.col1 AND content of file1.col2 to be found also in file2.col2).&lt;BR /&gt;
But on your example you only link 1 set of column.&lt;BR /&gt;
Do you know how I can join on multiple sets?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;BR /&gt;
B.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 11:47:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189816#M54673</guid>
      <dc:creator>bladeboxe</dc:creator>
      <dc:date>2015-05-19T11:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Join Two source based on content of fields present in other fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189817#M54674</link>
      <description>&lt;P&gt;you can try putting join max=0 type=outer service_tag col2 col3 col4&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 12:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189817#M54674</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-19T12:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Join Two source based on content of fields present in other fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189818#M54675</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Thank you already for taking the time to answer.&lt;BR /&gt;
Actually, I definitely get what you propose, but this assume that col2 and col3 and col4 are actually present in both files (which is not the case).&lt;BR /&gt;
What I have is (for a set of columns) :&lt;/P&gt;

&lt;P&gt;[first set of columns to compare]&lt;/P&gt;

&lt;P&gt;FILE 1 : col2 - "REF4B" and in FILE 2 : colX - "we have all sort of comment where the REF4B is included eventually"&lt;/P&gt;

&lt;P&gt;[second set of columns to compare]&lt;/P&gt;

&lt;P&gt;FILE 1 : col3 - "ssh" and in FILE 2 : colY - "those services (sshd, ftpd) are running into this server"&lt;/P&gt;

&lt;P&gt;And I need to cross the two sets.&lt;/P&gt;

&lt;P&gt;I gave a simple example so that it would be more easier to get but actually it is about multiple sets.&lt;/P&gt;

&lt;P&gt;Hope I didn't tired you already! Thanks!&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
B.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 12:28:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-Two-source-based-on-content-of-fields-present-in-other/m-p/189818#M54675</guid>
      <dc:creator>bladeboxe</dc:creator>
      <dc:date>2015-05-19T12:28:57Z</dc:date>
    </item>
  </channel>
</rss>

