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!

Splunk is Nurturing Tomorrow’s Cybersecurity Leaders Today

Meet Carol Wright. She leads the Splunk Academic Alliance program at Splunk. The Splunk Academic Alliance ...

Part 2: A Guide to Maximizing Splunk IT Service Intelligence

Welcome to the second segment of our guide. In Part 1, we covered the essentials of getting started with ITSI ...

Part 1: A Guide to Maximizing Splunk IT Service Intelligence

As modern IT environments continue to grow in complexity and speed, the ability to efficiently manage and ...