Splunk Search

How to add lookup files manually?

isedrof
Engager

Hi Everybody,

I want to ask you, how we can add lookup files into Splunk manually? I'm working on a script that can do this, but the problem is when I do it manually, I don't get a result when I search, even with the same file that I add in Splunk Web.
Thank you.

Tags (3)
0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

Hi isedrof,

you can do something like this in a script:

echo "foo,boo
a,1
b,2" > /opt/splunk/etc/system/lookups/lookup.csv

and use it like this in Splunk:

| inputlookup lookup.csv

this will be the result:

alt text

Hope this helps ...

cheers, MuS

View solution in original post

MuS
SplunkTrust
SplunkTrust

Hi isedrof,

you can do something like this in a script:

echo "foo,boo
a,1
b,2" > /opt/splunk/etc/system/lookups/lookup.csv

and use it like this in Splunk:

| inputlookup lookup.csv

this will be the result:

alt text

Hope this helps ...

cheers, MuS

isedrof
Engager

like always u help me..thank you so much It works !

0 Karma

woodcock
Esteemed Legend

What do you mean by "manually"? If you mean as a result of a search, then you just add | outputlookup myLookupFileName. If you mean using ftp or DeploymentServer to put a file onto your Indexers, then, again, just put the file somewhere. In either case, you still have to define the lookup file before you can use it by adding an entry in Settings -> Lookups -> Lookup Definitions -> New. You may also have to adjust your permissions.

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