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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...