<?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 Join DBConnect SQL query with other datasets in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-DBConnect-SQL-query-with-other-datasets/m-p/161262#M185975</link>
    <description>&lt;P&gt;Hello DB pros,&lt;/P&gt;

&lt;P&gt;I'm using DBConnect to query a specific table in an Oracle DB (let's call it "oracle"), which has the column "FLOW_ID". In another dataset (let's call it simply "dataset"), which is &lt;STRONG&gt;NOT&lt;/STRONG&gt; imported from a DB, contains the field FlowId.&lt;/P&gt;

&lt;P&gt;What I wish to do is to JOIN the results of the DB query and the data from "datasets" where FLOW_ID=FlowId. &lt;/P&gt;

&lt;P&gt;In SQL, it would probably look like this:&lt;BR /&gt;
Select *&lt;BR /&gt;
From oracle a, dataset b&lt;BR /&gt;
Where a.FLOW_ID=b.FlowId&lt;/P&gt;

&lt;P&gt;I've read about the JOIN function in Splunk documentation as well as in different blogs and previous questions (e.g &lt;A href="http://answers.splunk.com/answers/76183/splunk-db-connect-multiple-db-join" target="_blank"&gt;here&lt;/A&gt;, but I couldn't find any information about joining a DB Query with other source types.&lt;/P&gt;

&lt;P&gt;I've tried the following queries, but none seem to work:&lt;/P&gt;

&lt;P&gt;#1   | dbquery "oracle" "SELECT * FROM sometable"  | JOIN FLOW_ID [SEARCH sourcetype=dataset | rename FlowId as "FLOW_ID" | FIELDS FLOW_ID TIMESTAMP]&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;I suppose that since the fields names are different this doesn't won't work, so I also tried to rename dataset.FlowId into "FLOW_ID"&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;#2 | dbquery "Oracle" SELECT * FROM sometable"  | append [SEARCH sourcetype=dataset | FIELDS ] | WHERE FLOW_ID=FlowId&lt;/P&gt;

&lt;P&gt;Any help will be &lt;STRONG&gt;GREATLY&lt;/STRONG&gt; appreciated - as you can see, I'm pretty stuck.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 15:23:30 GMT</pubDate>
    <dc:creator>osherma</dc:creator>
    <dc:date>2020-09-28T15:23:30Z</dc:date>
    <item>
      <title>Join DBConnect SQL query with other datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-DBConnect-SQL-query-with-other-datasets/m-p/161262#M185975</link>
      <description>&lt;P&gt;Hello DB pros,&lt;/P&gt;

&lt;P&gt;I'm using DBConnect to query a specific table in an Oracle DB (let's call it "oracle"), which has the column "FLOW_ID". In another dataset (let's call it simply "dataset"), which is &lt;STRONG&gt;NOT&lt;/STRONG&gt; imported from a DB, contains the field FlowId.&lt;/P&gt;

&lt;P&gt;What I wish to do is to JOIN the results of the DB query and the data from "datasets" where FLOW_ID=FlowId. &lt;/P&gt;

&lt;P&gt;In SQL, it would probably look like this:&lt;BR /&gt;
Select *&lt;BR /&gt;
From oracle a, dataset b&lt;BR /&gt;
Where a.FLOW_ID=b.FlowId&lt;/P&gt;

&lt;P&gt;I've read about the JOIN function in Splunk documentation as well as in different blogs and previous questions (e.g &lt;A href="http://answers.splunk.com/answers/76183/splunk-db-connect-multiple-db-join" target="_blank"&gt;here&lt;/A&gt;, but I couldn't find any information about joining a DB Query with other source types.&lt;/P&gt;

&lt;P&gt;I've tried the following queries, but none seem to work:&lt;/P&gt;

&lt;P&gt;#1   | dbquery "oracle" "SELECT * FROM sometable"  | JOIN FLOW_ID [SEARCH sourcetype=dataset | rename FlowId as "FLOW_ID" | FIELDS FLOW_ID TIMESTAMP]&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;I suppose that since the fields names are different this doesn't won't work, so I also tried to rename dataset.FlowId into "FLOW_ID"&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;#2 | dbquery "Oracle" SELECT * FROM sometable"  | append [SEARCH sourcetype=dataset | FIELDS ] | WHERE FLOW_ID=FlowId&lt;/P&gt;

&lt;P&gt;Any help will be &lt;STRONG&gt;GREATLY&lt;/STRONG&gt; appreciated - as you can see, I'm pretty stuck.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-DBConnect-SQL-query-with-other-datasets/m-p/161262#M185975</guid>
      <dc:creator>osherma</dc:creator>
      <dc:date>2020-09-28T15:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Join DBConnect SQL query with other datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-DBConnect-SQL-query-with-other-datasets/m-p/161263#M185976</link>
      <description>&lt;P&gt;is the data in oracle dimensional data or event data?   if dimensional data and not rapidly changing, why not output the results of your dbquery to oracle to a lookup table?   if the content in oracle is event data, is it feasible for you to index the data by tailing the table as an event source?  I imagine it would be very slow to join very large data sets among indexers and remote data sources through dbquery at search time.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2013 19:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-DBConnect-SQL-query-with-other-datasets/m-p/161263#M185976</guid>
      <dc:creator>dstaulcu</dc:creator>
      <dc:date>2013-12-01T19:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Join DBConnect SQL query with other datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-DBConnect-SQL-query-with-other-datasets/m-p/161264#M185977</link>
      <description>&lt;P&gt;Thank you for your answer.&lt;BR /&gt;
It is event data, and unfortunately, due to its size (hundreds of GBs), cannot be "dumped" into an event source .&lt;/P&gt;

&lt;P&gt;I also assume that the queries will take time, but I still wonder how to write queries that work...any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 07:51:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-DBConnect-SQL-query-with-other-datasets/m-p/161264#M185977</guid>
      <dc:creator>osherma</dc:creator>
      <dc:date>2013-12-02T07:51:46Z</dc:date>
    </item>
  </channel>
</rss>

