Splunk Search

How to combine two csv?

siva_1
New Member

Hi All,

I have two csv files. 

File1.csv -> id, operation_name, session_id

File2.csv -> id, error, operation_name

I want to list the entries based on session_id like ->id, operation_name, session_id, error. Basically all the entries from file1.csv for the session_id and errors from file2.csv. 

Could you please help how to combine these csv?

Note: I am storing the data to CSV as a output lookup since I couldn't find a way to search these via single query. So trying to join from csv.

Labels (3)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

session_id doesn't appear to exist in both look ups so you won't be able to "join" using that. If you mean you want to "join" by id, then a simple lookup should work

| inputlookup File1.csv
| lookup File2.csv id

Alternatively, if you want to use both the id and operation name you could try something like this

| inputlookup File1.csv
| lookup File2.csv id operation _name
0 Karma

siva_1
New Member

@ITWhisperer File1.csv has the session_id.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Exactly! So how do you match entries in File2.csv?

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...