Splunk Search

How to combine the results of searches from two CSV files?

ibmrakesh
Explorer

Hi All,
I am new to Splunk world, Please help me to explore.

I have two CSV files let's say

table_1.csv with fields 'Bus No', 'Booking ID', 'start Time', 'End Time', 'Source', 'Destination'
table_2.csv with fields 'Bus No', 'Booking ID', 'Via','Halting Timings','Passenger counts', 'Failures', etcs.

I need to somehow join the two csv files to get the details i.e 'Bus No', 'Booking ID', 'Passenger counts', 'Failures', 'start Time', 'End Time', 'Source', 'Destination' but the condition is like below.
If there are any failures ( i.e failures > 0 ) in table_2.csv file, then get the 'Bus No', 'Booking ID' from the table_2.csv file and match with the 'Bus No', 'Booking ID' field in table_1.csv. If it is there, then get the information of 'Bus No', 'Booking ID', 'Passenger counts', 'Failures', 'start Time', 'End Time', 'Source', 'Destination' in output.

Thanks In Adv.

0 Karma

somesoni2
Revered Legend

Assuming the csv data is indexed in Splunk, give this a try

index=foo sourcetype=bar (source=*table_1.csv OR source=*table_2.csv)
| table "Bus No" "Booking ID" "start Time" "End Time" "Source" "Destination" "Via" "Halting Timings" "Passenger counts" "Failures"
| stats values(*) as * by  "Bus No" "Booking ID" | where 'Failures'>0
0 Karma

ibmrakesh
Explorer

@somesoni2: Thanks for the response. As I am a beginner can you please help me how to create a index in my scenario, I mean how to change the inputs.conf and props.conf files based on this scenario.

0 Karma
Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...