Splunk Search

How to use fields from two csv files in a search for an arithmetic calculation to create a new field?

karthikTIL
Path Finder

HI,

I have two files, test1.csv and test2.csv.
I want to do some arithmetic calculation involving fields from both files test1.csv and test2.csv.
Also, i want to use only september month data from test1.csv.Please let me know how to involve both files in a single query to cter to my requirement.

test1.csv has fields ->name,start time,end time,total_time,date_month
test2.csv has fields->name,No_of_Person,lost_time

What i require is, if date_month=september from test1.csv and 'name' from test1.csv ='name' from test2.csv,then A=total_time*No_of_Person*lost_time, where 'A' is a new field i want to create.

Tags (3)
0 Karma

Ayn
Legend

How about

| inputlookup test1.csv | search date_month="september" | join name [inputlookup test2.csv] | eval A=total_time*No_of_Person*lost_time

Ayn
Legend

Please add more information - exactly what kind of calculations, and what your csv files look like.

0 Karma

karthikTIL
Path Finder

test1.csv has fields ->name,start time,end time,total_time,date_month
test2.csv has fields->name,No_of_Person,lost_time

What i require is, if date_month=september from test1.csv and 'name' from test1.csv ='name' from test2.csv,then A=total_time*No_of_Person*lost_time, where 'A' is a new field i want to create.

0 Karma
Get Updates on the Splunk Community!

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 ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...