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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...