<?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 How to join a DB search with a lookup.csv? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-join-a-DB-search-with-a-lookup-csv/m-p/365368#M66513</link>
    <description>&lt;P&gt;I have a database search that pulls back a list of ID's for me and I also have a Lookup that has the titles and the IDs that relates to the DB ID's. For example, see the below:&lt;/P&gt;

&lt;P&gt;DB table has this ID: 123456&lt;BR /&gt;
lookup csv has this title and ID: rhubarb and 123456&lt;/P&gt;

&lt;P&gt;The DB table has lots of other information in there which is why I need to join them to get more information and I can't find anything similar on Splunk. I have put my test query below but doesn't work so any advice  is appreciated&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbxquery connection="gg" query="SELECT * from idstudio" | rename Id1 as Id2 | join Id1 [search lookup Idslookup.csv]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 Mar 2018 13:34:20 GMT</pubDate>
    <dc:creator>Sfry1981</dc:creator>
    <dc:date>2018-03-20T13:34:20Z</dc:date>
    <item>
      <title>How to join a DB search with a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-join-a-DB-search-with-a-lookup-csv/m-p/365368#M66513</link>
      <description>&lt;P&gt;I have a database search that pulls back a list of ID's for me and I also have a Lookup that has the titles and the IDs that relates to the DB ID's. For example, see the below:&lt;/P&gt;

&lt;P&gt;DB table has this ID: 123456&lt;BR /&gt;
lookup csv has this title and ID: rhubarb and 123456&lt;/P&gt;

&lt;P&gt;The DB table has lots of other information in there which is why I need to join them to get more information and I can't find anything similar on Splunk. I have put my test query below but doesn't work so any advice  is appreciated&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbxquery connection="gg" query="SELECT * from idstudio" | rename Id1 as Id2 | join Id1 [search lookup Idslookup.csv]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Mar 2018 13:34:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-join-a-DB-search-with-a-lookup-csv/m-p/365368#M66513</guid>
      <dc:creator>Sfry1981</dc:creator>
      <dc:date>2018-03-20T13:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to join a DB search with a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-join-a-DB-search-with-a-lookup-csv/m-p/365369#M66514</link>
      <description>&lt;P&gt;You need to create a lookup definition on that csv lookup. For that follow this: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/Knowledge/ConfigureCSVlookups"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/Knowledge/ConfigureCSVlookups&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;After you have created a lookup definition, let's say you named it ldslookup,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbxquery connection="gg" query="SELECT * from idstudio" 
| lookup Id Idslookup OUTPUT &amp;lt;whatever field you want form the lookup&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Mar 2018 13:41:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-join-a-DB-search-with-a-lookup-csv/m-p/365369#M66514</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-20T13:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to join a DB search with a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-join-a-DB-search-with-a-lookup-csv/m-p/365370#M66515</link>
      <description>&lt;P&gt;Please let me know if the answer was useful for you. If it was, accept it and upvote. If not, give us more input so we can help you with that&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 17:29:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-join-a-DB-search-with-a-lookup-csv/m-p/365370#M66515</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-21T17:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to join a DB search with a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-join-a-DB-search-with-a-lookup-csv/m-p/365371#M66516</link>
      <description>&lt;P&gt;Thanks for the response. I have done this but when i run the query it does not pull anything through from the lookup and only pulls through the db query. I currently have the below:&lt;/P&gt;

&lt;P&gt;| dbxquery connection="gg" query="SELECT * from idtable" | eval ParentId2=substr(ParentId , 1, len(ParentId )-3) &lt;BR /&gt;
 | lookup CommunityTitles2 KBID OUTPUT Title&lt;/P&gt;

&lt;P&gt;In your lookup you have the column name prior to the lookup which came back with an error message so i swapped it around. Any idea why it is not pulling anything back from the lookup table?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 21:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-join-a-DB-search-with-a-lookup-csv/m-p/365371#M66516</guid>
      <dc:creator>Sfry1981</dc:creator>
      <dc:date>2018-03-21T21:04:29Z</dc:date>
    </item>
  </channel>
</rss>

