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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...