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
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...