Splunk Search

multiple sources

Wilfred
Engager

Hi,

I just started working with Splunk and would ask for some help.

I have 3 sources, A, B and C.

Source A contains fields Ordernr, Salesvalue 

Source B contains fields Ordernr, Status

Source C contains fields Ordernr, Producttype 

All sources have around few million records.

What i would like to get is a result set with:

A.Ordernr, A.Salesvalue, C.Producttype 

where

A.Ordernr not exists in B.Status=700

and A.Ordernr exists in C.Ordernr

Hope my question is clear 

Thanks in advance for helping me out!

 

 

 

What i would like to do is to have a resul

 

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You could try something along these lines

search Source A
| table Ordernr, Salesvalue 
| join type=left Ordernr [search Source B
  | table Ordernr, Status]
| fillnull value=700 Status
| join Ordernr [search Source C
  | table Ordernr, Producttype] 

Although given the limitations of joins, you could try something like this

search Source A
| table Ordernr, Salesvalue 
| append [search Source B
  | table Ordernr, Status]
| fillnull value=700 Status
| append [search Source C
  | table Ordernr, Producttype] 
| stats values(Salesvalue) as Salesvalue values(Status) as Status by Ordernr
| where isnotnull(Salesvalue)

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You could try something along these lines

search Source A
| table Ordernr, Salesvalue 
| join type=left Ordernr [search Source B
  | table Ordernr, Status]
| fillnull value=700 Status
| join Ordernr [search Source C
  | table Ordernr, Producttype] 

Although given the limitations of joins, you could try something like this

search Source A
| table Ordernr, Salesvalue 
| append [search Source B
  | table Ordernr, Status]
| fillnull value=700 Status
| append [search Source C
  | table Ordernr, Producttype] 
| stats values(Salesvalue) as Salesvalue values(Status) as Status by Ordernr
| where isnotnull(Salesvalue)
0 Karma

Wilfred
Engager

Worked almost fine tat once, had to change the fillnull value to 0 to avoid that all orders get status 700 which not exists.

Thanks a lot helping me out!

Tags (1)
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!

Make Your Machine Data AI-Ready in Splunk

Every team is getting ready for AI agents.   Thursday, November 12, 2026  |  11AM  PST / 2PM EST   ...

Splunk Asynchronous Forwarding Explained

Splunk asynchronous forwarding is often misunderstood as simply setting autoLBVolume. That is not quite right. ...

How to Monitor AI Agents with Splunk Agent Observability

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