Splunk Search

How do I combine data from two different sources without the append or the union command?

atozeswar
New Member

Hi,

is there any way to combine data from two different sources without the append or the union command?

I have a code like this..

Index=csvl source="file1. Csv" or source="file2. Csv" |

First searching from some data from first source file1.csv
Next searching from some data from 2nd source file2.csv

At least I'm using append to combine both results. Is there any way to remove append or union from the query..?

Thank you..

Tags (1)
0 Karma

sdchakraborty
Contributor

Hi,
If you have matching fields in both the data sets you can use "join" command. like,

[data_set1]
| join type = inner/left
[data set 2]

Sid

0 Karma

bjoernjensen
Contributor

Hey,

that depends on your data. Does file1 and file2 have totally distinct columns?

If you want them to be combined you need some kind of "key" to match them. Or to be more specific: You need a "rule" which tells you a mapping of rows of file1 to rows of file2. And this mapping has to be a 1-to-1 relation, usually induced by a key value. This could be _time, could be a combination of values within each file.

If _time can be used as your key, you might work with bin _time span=1m and continue with stats latest(value) (keep in mind you are aggregating here and might "loose" a value using latest. Test this by using list()).

Hope that helps,
Björn

0 Karma

kmorris_splunk
Splunk Employee
Splunk Employee

Can you provide a little more detail on what you would like as the end result?

0 Karma

atozeswar
New Member

Some rows of data from file1 and some rows of data from files2. I need to append both and make a table but without using append..

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!

How much can you really learn in 3 minutes?

Observability can certainly be hard to understand – there's a lot of jargon and buzzwords and it seems to ...

Event Series: The Agentic SOC: Trust Before Autonomy

AI is fundamentally changing security operations, but true progress requires more than just automation—it ...

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...