Splunk Search

Lookup in the Index Time

abhayneilam
Contributor

Hi,

I have a file coming from the source ( UF ) in which I am getting two fields ( IP and PORT ) , Now I have a lookup file also in which I have four additional fields ( IP, NAME,SOURCE,DESTINATION).

Question is : I dont want to index the source file as it is rather I would like to do the lookup before the data gets stored in the indexer.
Once the lookup is done based on the IP present in the Lookup file as well as the source file, I will have the complete set of data for all the matched IPs, that data I want to index in the indexer.

Kindly help !!

Cheers,

Tags (4)
0 Karma

sbbadri
Motivator

Create a app in indexer ,

$SPLUNK_HOME$/etc/(apps OR master-apps)/yourapp/lookups/

yourlookup.csv should be reside in this folder.

$SPLUNK_HOME$/etc/(apps OR master-apps)/yourapp/local/transforms.conf

[yourlookup]
filename=yourlookup.csv

$SPLUNK_HOME$/etc/(apps OR master-apps)/yourapp/local/props.conf

[sourcetype set in UF]
LOOKUP-test = yourlookup IP as IP OUTPUTNEW NAME SOURCE DESTINATION

i hope this helps.

0 Karma

abhayneilam
Contributor

Amazing reply !! but the entire field is coming ( showing in the indexer ), but when I search for the same index with the sourcetype in the search head , those extra lookup(ed) fields are not showing !! I want to get (see) the data in the search head !!

0 Karma

sbbadri
Motivator

ah okay..

[sourcetype set in UF]
LOOKUP-test = yourlookup IP as IP OUTPUTNEW NAME as lname, SOURCE as lsource, DESTINATION as ldest
EVAL-name = lname
EVAL-source= lsource
EVAL-dest = ldest

If above thing haven't work, then do the same steps in search head as well. Path will be little different

1) Deployer - $SPLUNK_HOME$/etc/shcluster/apps/yourapp/local/
2) Standalone SH - $SPLUNK_HOME$/etc/apps/yourapp/local

/lookups/

yourlookup.csv should be reside in this folder.

/transforms.conf

[yourlookup]
filename=yourlookup.csv

/props.conf

[sourcetype set in UF]
LOOKUP-test = yourlookup IP as IP OUTPUTNEW NAME SOURCE DESTINATION

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...