Splunk Search

How do you fetch table data from join table?

flzhang132
Explorer

There are two tables: "Table A" is a detailed information, and the "Table B" is the primary key.

The two tables are associated with the primary key and only queries the information in the matching A table.

Be similar to sql
seledt T1.id from T1,T2 where T1.id=T2.id
alt text

Tags (1)
0 Karma

renjith_nair
Legend

@flzhang132 ,

Assuming you have different indexes or source types where you have this data,

"your search to get first dataset" OR "your search to get the second dataset" 
|stats values(project_name) as project_name,values(region) as region,values(fee) as fee,values(dmon) as domon by resourceid

Another option is to use join, which should be avoided if possible due to performance considerations

"your search to get first dataset"
|join resourceid ["your search to get the second dataset"]
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

flzhang132
Explorer

please ? How can i get data from same table with self join
Be similar to sql
select T2.id
from table T1
,table T2
where T1.id = T2.id

0 Karma

renjith_nair
Legend

@flzhang132 , do you mean to say, you have these events in the same source? just for clarification, why do you need this join when you dont have any interesting field in the other dataset but all the fields are in say table A ? Do you have some sample events (mask any confidential data) to let us know what you have and what's your expected output

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

asabatini85
Path Finder

In that case it's better use the transaction comand for the self join.

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!

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...

Deep insights, no barriers: Splunk Observability Cloud Free Edition

As software delivery cycles continue to accelerate, observability shouldn’t be a luxury — it should be a ...

Monitoring AI Agents with Splunk Observability Cloud

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...