Splunk Search

How to have lookup iplocation fields added to all events at index time?

dmcbray
New Member

I would like to have iplocation fields added to all events when they're ingested and have verified the lookup works in the search app. I've done something similar with dnsLookups in props.conf, but doing the same for iplocation doesn't appear to function the same. Here's what I've tried in my props.conf:

LOOKUP-iplocation_src = iplocation prefix=src_ allfields=true srcip 
LOOKUP-iplocation_dst = iplocation prefix=dst_ allfields=true dstip

With that I get: The lookup table 'iplocation' does not exist. when searching. Do I need to reference the iplocation lookup in my transforms.conf?

Thanks.

0 Karma
1 Solution

somesoni2
Revered Legend

The dnsLookup is an external lookup hence you're able to setup search time (as mentioned by @dshpritz) automatic lookup for it.
The iplocation is a custom search command hence it's not available as the automatic lookup.

You can see the difference in the way both are invoked in search

base search | lookup dnsLookup ip as clientip OUTPUT host

base search | iplocation clientip

View solution in original post

0 Karma

somesoni2
Revered Legend

The dnsLookup is an external lookup hence you're able to setup search time (as mentioned by @dshpritz) automatic lookup for it.
The iplocation is a custom search command hence it's not available as the automatic lookup.

You can see the difference in the way both are invoked in search

base search | lookup dnsLookup ip as clientip OUTPUT host

base search | iplocation clientip
0 Karma

dmcbray
New Member

Thanks @dshpritz & @somesoni2. I do see the difference between the two, but was hoping there was something I was missing that would make it work. I also wasn't aware the automatic lookups didn't add the fields at indexing. The goal was to spread the load of those lookups over time instead of a massive amount of lookups at search time.

0 Karma

dshpritz
SplunkTrust
SplunkTrust

Just a note that lookups don't occur on indexing. They occur on search. This means that if you configure iplocation as an automatic lookup, then when a user searches the data, the iplocation will occur, which may have some search performance implications.

0 Karma
Get Updates on the Splunk Community!

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

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