Splunk Search

Lookup does not return data

pramit46
Contributor

I am doing a small proof of concept on lookup command.
I have a look up csv file with the table:

env    status    date
prod     up    7/21/2016
int      up    7/20/2016
sit     down   7/19/2016
qa      down   7/21/2016
test    down   7/20/2016
stage   down   7/18/2016

Now I have setup the lookup definition ( lookup_try ) with global permission.

Then I try to run this command:

index=* |head 1|eval env="Prod"|lookup lookup_try env OUTPUT status date 

It does not print the values of status and date. Where am I going wrong?

0 Karma
1 Solution

hardikJsheth
Motivator

You can make lookup search case insensitive by adding case_sensitive_match =false in your lookup stanza.

View solution in original post

0 Karma

hardikJsheth
Motivator

You can make lookup search case insensitive by adding case_sensitive_match =false in your lookup stanza.

0 Karma

woodcock
Esteemed Legend

Lookups are CASE-SENSITIVE by default (but there is a setting to make them case-insensitive). Try this (cut and paste exactly as is):

| noop | stats count AS env |eval env="prod" | lookup lookup_try env

gcusello
SplunkTrust
SplunkTrust

are you sure of the name of the lookup? its name is lookup_try or lookup_try.csv?
You can try it with | inputlookup command
| inputlookup lookup_try.csv
Bye.
Giuseppe

0 Karma

Javip
Path Finder

Hi!

I suppose you've tested this search before and you can see your CSV list:
| inputlookup lookup_try.csv

If ok, try this:
index=* |head 1|eval env="prod"|lookup lookup_try env OUTPUT status date

Regards.

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...