Splunk Search

inputlookup csv

keyu921
Explorer

I setup testing.csv lookup as following
host,location
123,HK
234,US
345,UK

I would like to basic search if host matched in the log, stats count by location
index=log sourcetype=csv |search [|inputlookup testing | return $host]
| stats .... by location

But seems return nothings

Labels (2)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @keyu921,
the command to use is lookup, try something like this:

index=log sourcetype=csv 
| lookup testing.csv host OUTPUT location
| stats count by location

Remember to define Lookup definitions.

Ciao.
Giuseppe

View solution in original post

0 Karma

keyu921
Explorer

index=* sourcetype=csv |search [|inputlookup testing| return 1000 $host]
| stats last(Size) last(Used) last(Use) by host

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @keyu921,
the command to use is lookup, try something like this:

index=log sourcetype=csv 
| lookup testing.csv host OUTPUT location
| stats count by location

Remember to define Lookup definitions.

Ciao.
Giuseppe

0 Karma

keyu921
Explorer

thanks seems i mix up inputlookup and lookup

0 Karma
Get Updates on the Splunk Community!

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

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...