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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...