<?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: Splunk DB Connect 1: How to join SQL queries from different servers? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123934#M184249</link>
    <description>&lt;P&gt;Does this work?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | dbquery Server1 "SELECT value1, value2 FROM db1.table"
  | join type=left value2 [search dbquery Server2 "SELECT value2, value3 FROM db2.table"]
  | table value1, value2, value3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(Replaced the pipe with &lt;CODE&gt;search&lt;/CODE&gt; in the subsearch)&lt;/P&gt;</description>
    <pubDate>Wed, 27 May 2015 18:18:57 GMT</pubDate>
    <dc:creator>aweitzman</dc:creator>
    <dc:date>2015-05-27T18:18:57Z</dc:date>
    <item>
      <title>Splunk DB Connect 1: How to join SQL queries from different servers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123931#M184246</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;    | dbquery Server1 "SELECT value1, value2 FROM db1.table"
    | join type=left value2 [| dbquery Server2 "SELECT value3 FROM db2.table"]
    | table value1, value2, value3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have two tables, in two databases on two different servers that I need to join.  They have a single common value (we'll say value2 here).  When running the actual code, "value3" is the same for every row.  I'm not sure where I have this wrong, but I don't understand how the splunk join works between two servers like this.&lt;/P&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 17:13:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123931#M184246</guid>
      <dc:creator>stevenahl</dc:creator>
      <dc:date>2015-05-27T17:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to join SQL queries from different servers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123932#M184247</link>
      <description>&lt;P&gt;It doesn't appear that you're returning &lt;CODE&gt;value2&lt;/CODE&gt; in your query from &lt;CODE&gt;Server2&lt;/CODE&gt;, so that's pretty much guaranteed &lt;STRONG&gt;not&lt;/STRONG&gt; to work. You need to have that field in the table you're joining with.&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 17:21:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123932#M184247</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-05-27T17:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to join SQL queries from different servers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123933#M184248</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; | dbquery Server1 "SELECT value1, value2 FROM db1.table"
 | join type=left value2 [| dbquery Server2 "SELECT value2, value3 FROM db2.table"]
 | table value1, value2, value3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Still does the same thing...&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 17:42:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123933#M184248</guid>
      <dc:creator>stevenahl</dc:creator>
      <dc:date>2015-05-27T17:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to join SQL queries from different servers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123934#M184249</link>
      <description>&lt;P&gt;Does this work?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | dbquery Server1 "SELECT value1, value2 FROM db1.table"
  | join type=left value2 [search dbquery Server2 "SELECT value2, value3 FROM db2.table"]
  | table value1, value2, value3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(Replaced the pipe with &lt;CODE&gt;search&lt;/CODE&gt; in the subsearch)&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 18:18:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123934#M184249</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-05-27T18:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to join SQL queries from different servers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123935#M184250</link>
      <description>&lt;P&gt;Still no joy.&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 18:54:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123935#M184250</guid>
      <dc:creator>stevenahl</dc:creator>
      <dc:date>2015-05-27T18:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to join SQL queries from different servers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123936#M184251</link>
      <description>&lt;P&gt;What database and version are you trying to query, is it SQL Server, MySQL or something else. If you were to remove Splunk from the equation and reduce it to a SQL conundrum, Using SQL Server if Server2 is defined as a linked server of Server1, the query could be satisfied with something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT a.col1, a.col2, b.col3
FROM   Server1.db1.owner.table a
LEFT OUTER JOIN Server2.db2.owner.table b
ON       a.col2= b.col2 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which uses a 4 part table identifier of the form MyServer.MyDatabase.TableOwner.Mytable&lt;/P&gt;

&lt;P&gt;Can you do something similar and use the database tools to manage the join and remove the Splunk join command?&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 21:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123936#M184251</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2015-05-27T21:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to join SQL queries from different servers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123937#M184252</link>
      <description>&lt;P&gt;put dollar signs around the values in the second dbquery&lt;/P&gt;</description>
      <pubDate>Sat, 30 May 2015 21:41:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123937#M184252</guid>
      <dc:creator>jcoates_splunk</dc:creator>
      <dc:date>2015-05-30T21:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to join SQL queries from different servers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123938#M184253</link>
      <description>&lt;P&gt;Agreed -- either do the work in SQL with optimized joins or index the data and do it in SPL, because this hybrid approach is the worst of both worlds.&lt;/P&gt;</description>
      <pubDate>Sat, 30 May 2015 21:42:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-join-SQL-queries-from-different/m-p/123938#M184253</guid>
      <dc:creator>jcoates_splunk</dc:creator>
      <dc:date>2015-05-30T21:42:56Z</dc:date>
    </item>
  </channel>
</rss>

