Splunk Search
Highlighted

How to search a list of words from csv file (lookup) in specific index events

Explorer

I have a lookup table which contains only one column with hundreds of entries, now I would like to search every word in splunk whether any event appear containing word from csv.

How can I achieve this?

any help will be appreciated.

Highlighted

Re: How to search a list of words from csv file (lookup) in specific index events

SplunkTrust
SplunkTrust

Hi onkarkore1,

you can try something like this:

 your base search here  [ | inputlookup yourLookupTableHere | return columnName ]

This will get all entries from the lookup and create a long search like this:

your base search here ( columnName=val1 OR columnName=val2 OR columnName=val3 .... )

Hope this helps to get you started ...

cheers, MuS

0 Karma
Highlighted

Re: How to search a list of words from csv file (lookup) in specific index events

Explorer

II have a lookup table named transaction.csv contains one colunm, transactionname. The goal is to have Splunk go through the lookup table and match text in the column named, transactionname. and return a matching term

Lookup table is "transaction.csv" having one column named, transaction_name it have N numbers of entries (1000 entries) follows:

transaction_name
status
result
failed
success
report
idle
....
Any help would be great. I have tried the below:

index=indexname [| inputlookup transaction.csv | eval search=transactionname | table search]

Above search query not returning matching terms in table format.

I would like to see output of matching terms(from csv file and events) in table format.

0 Karma
Highlighted

Re: How to search a list of words from csv file (lookup) in specific index events

Champion

Hi, Please check this one -

index=indexname [|inputlookup transaction.csv | return transactionname] 

0 Karma
Highlighted

Re: How to search a list of words from csv file (lookup) in specific index events

Explorer

I would like to see either matching or non-matching transaction names returned by transaction_name column from transaction.csv file with respect to events in index.

But above search query is not returning any data, when I executed above query it returned no result found.

0 Karma
Highlighted

Re: How to search a list of words from csv file (lookup) in specific index events

SplunkTrust
SplunkTrust

Please provide some useful raw events and your expected result, otherwise there is no way for anyone to help you get the result you want 😉

0 Karma
Highlighted

Re: How to search a list of words from csv file (lookup) in specific index events

Explorer

My index name is iot which is generating number of events as below,

index=iot

Below is the transaction value contained in transaction_name csv from transaction.csv lookup and events from iot index

trnsactionname: WSVCUpdateMilestone
160701 09:57:32.322 (I 4) [:0x0 0x5774c746 0x49ce2b 0x28 0x0 0x0:N
MlIsMd] Workflow (FX we_WorkflowUpdate.c 272) Status returning by WSVCUpdateMilestone: 0

transactionname: Workflow
160701 09:57:32.322 (I 4) [:0x0 0x5774c746 0x49ce2b 0x28 0x0 0x0:N
MlIsMd] Workflow (FX we_WorkflowUpdate.c 272) Status returning by WSVCUpdateMilestone: 0

transactionname: DBServerId
160701 09:57:32.266 (D 5) [:0x0 0x5774c746 0x49ce2b 0x28 0x0 0x0:N
MlIsMd] DBServerId (FX wf_Engine.c 659) Account server: 3

transactionname: CallData
160701 09:57:32.266 (I 4) [:0x0 0x5774c746 0x49ce2b 0x28 0x0 0x0:N
MlIsMd] CallData (FX wf_Engine.c 701) CONTENT IN DEBUG FILE

Now, I have a lookup table named transaction.csv contains one colunm, transactionname. The goal is to have Splunk go through the lookup table and match text in the column, transactionname with the index iot. and return either matching or non-matching term

Lookup table is "transaction.csv" having one column named, transaction_name it have N numbers of entries (1000 entries) follows:

transaction_name
WSVCUpdateMilestone
Workflow
DBServerId
CallData
....
These are thousands of transaction name contained in lookup table, we want to check whether index is returning any events containing above transaction value.

Manually executing search query is difficult for thousands of entries like,

index="indexname" "transactionname"

This is why we want to use lookup which will go through index events and return list of either matching or non_matching transaction values from table.

Any help would be great. I have tried the below:

index=iot [|inputlookup transaction.csv | return transaction_name]

But above search query is not returning any data, when I executed above query it returned no result found.

0 Karma