Splunk Search

How to refer to a lookup CSV file I just uploaded in a search?

jackywsy
Explorer

Hi Everyone,

I have uploaded a CSV file to the lookup table. Only one column of data is in the list. for e.g. I put some web links into the list,

*.baidu.com
*.sina.com.cn
*.sohu.com
.....

How do I write a search to refer to the CSV file? Do I have put the info into a transforms.conf file?

I want to run a search like:

index=* sourcetype=websence http_method=post NOT  {(*THE CSV FILE OF THE WEBSITE LINKS*)"} ..... | stats ...

Please help...

0 Karma

woodcock
Esteemed Legend

Like this:

index=* sourcetype=websence http_method=post NOT [inputcsv YouCSVFile | rename InsideCSVFieldName AS EventDataFieldName] ..... | stats ...
0 Karma

sduff_splunk
Splunk Employee
Splunk Employee

Firstly, refer to http://answers.splunk.com/answers/52580/can-we-use-wild-characters-in-lookup-table.html about setting up a lookup with wildcards. You may also want to add an additional field to the lookup file (maybe call it 'in_lookup').

Then you will want to do the following search...

index=* sourcetype=websence http_method=post | lookup weblink_lookup | where NOT in_lookup="*"
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...