Splunk Search

How to use a Lookup table or an Imported CSV file to perform a search

andres91302
Communicator

Hello Everyone and welcome

is there a way to import a csv file to then use it a search parameter to search for events within an index in splunk? I am trying to  find the total bill cost of some patients in a hospital but I am only interested in some IDs I have in a CSV file I use this code to find total bill amount

index="rea_host"
search ID=* AND bill_due=*
| stats values(bill_due) by ID

I am trying to use a CVS file named "STATUS" where the ID fields has the name "patient_documentation"

I type:

index="rea_host"
search bill_due=* AND [  lookup  STATUS OUTPUT patient_documentation as ID]
| stats values(bill_due) by ID

 

with no luck, can someone please help me out? thank you so much

 

Labels (1)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@andres91302 

Did you tried this?

index="rea_host" bill_due=* [ | inputlookup STATUS OUTPUT patient_documentation as ID | table ID]
| stats values(bill_due) by ID

 

Thanks
KV
▄︻̷̿┻̿═━一

If this reply helps you, an upvote would be appreciated.

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

@andres91302 

Did you tried this?

index="rea_host" bill_due=* [ | inputlookup STATUS OUTPUT patient_documentation as ID | table ID]
| stats values(bill_due) by ID

 

Thanks
KV
▄︻̷̿┻̿═━一

If this reply helps you, an upvote would be appreciated.

Get Updates on the Splunk Community!

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

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...