Splunk Search

How to combine multiple events from two indexes in Splunk

welcome
Engager

1st query:  index="A" event_tag="event1" build_number=1 job_name=job1 type=completed  

2nd query:  index="B" event_tag="event2" build_number=1 job_name=job1

We have some events in indexA and some events in indexB ,how to combine these using common fileds are build_number and job_name.

What will the query

 

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

There are a few ways to combine searches, but the preferred way uses the general form:

(<<query 1>>) OR (<<query 2>>)
| stats values(*) as * by <<common fields>>
---
If this reply helps you, Karma would be appreciated.

welcome
Engager

It is showing statistical information but not merging ,I want events from indexA and indexB together as single event .What will be the query and how can I know merging was happened .
I don't want table or statistics format 

 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The join command should produce the format you seek, but you'll be unhappy with the performance.  That's why the previous method I suggested is preferred.

<<query 1>>
| join <<common fields>> [ <<query 2>> ]

 

---
If this reply helps you, Karma would be appreciated.
0 Karma

welcome
Engager

Join command is ok ,but how can know these two index events are combined,how can I see the combined data.Please give the proper answer

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The indexed events are not combined.  Indexed data is never changed so the events will forever remain separated.  All we can do is correlate data from the indexes and display it in an appropriate format.  You can, however, write the correlated data to a summary index using the collect command then fetch the events in the summary index to see a combined event.

---
If this reply helps you, Karma would be appreciated.
0 Karma

welcome
Engager

But we have some events of job in indexA and some events of job in indexB ,suppose if we want to create a table all events of same job,how can we do that 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

My first answer said how to create a table with events of the same job from both indexes, but then you said you don't want a table.

---
If this reply helps you, Karma would be appreciated.
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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...