Splunk Search

Join DBConnect SQL query with other datasets

osherma
Explorer

Hello DB pros,

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 NOT imported from a DB, contains the field FlowId.

What I wish to do is to JOIN the results of the DB query and the data from "datasets" where FLOW_ID=FlowId.

In SQL, it would probably look like this:
Select *
From oracle a, dataset b
Where a.FLOW_ID=b.FlowId

I've read about the JOIN function in Splunk documentation as well as in different blogs and previous questions (e.g here, but I couldn't find any information about joining a DB Query with other source types.

I've tried the following queries, but none seem to work:

#1 | dbquery "oracle" "SELECT * FROM sometable" | JOIN FLOW_ID [SEARCH sourcetype=dataset | rename FlowId as "FLOW_ID" | FIELDS FLOW_ID TIMESTAMP]

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"

#2 | dbquery "Oracle" SELECT * FROM sometable" | append [SEARCH sourcetype=dataset | FIELDS ] | WHERE FLOW_ID=FlowId

Any help will be GREATLY appreciated - as you can see, I'm pretty stuck.

1 Solution

dstaulcu
Builder

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.

View solution in original post

0 Karma

dstaulcu
Builder

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.

0 Karma

osherma
Explorer

Thank you for your answer.
It is event data, and unfortunately, due to its size (hundreds of GBs), cannot be "dumped" into an event source .

I also assume that the queries will take time, but I still wonder how to write queries that work...any ideas?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Data Management Digest – August 2026

MichelleCorpora_1-1788182384472.png Welcome to the August 2026 edition of Data Management Digest! August was a ...

Your Feedback. Our Roadmap. Visit the PX Feedback Booth at .conf26

You use Splunk every day, come and help shape what's next.  Save Your Seat: Product-Focused Sessions at ...

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...