Splunk Search

Automatic lookup failing

ipops
Path Finder

I have a lookup working when I use "lookup" manually in my search.alt text I cannot seem to get this working as an automatic lookup though.

This search works and returns the lookup fields

sourcetype=ivrdata | WHERE IVR_Message="Phone" | rename IVR_Value AS areacode | rex field=areacode mode=sed "s/(\d{3})(\d{3})(\d{4})/\1-\2/g" | table areacode | lookup AreaCodeLookup areacode

This search simply returns the areacodes but all other fields (city, region, etc) are blank

sourcetype=ivrdata | WHERE IVR_Message="Phone" | rename IVR_Value AS areacode | rex field=areacode mode=sed "s/(\d{3})(\d{3})(\d{4})/\1-\2/g" | table areacode city region latitude

My automatic lookup is defined as
AreaCodeLookup areacode AS phone_no OUTPUTNEW city country latitude AS _lat longitude AS _lng region

What am I missing here to get automatic lookup working?

Tags (1)
0 Karma

sundareshr
Legend

It appears your lookup is dependent on a field that has not been extracted. Add areacode to field extraction on your search head and try the auto lookup. The reason it works in the GUI is because you have a rex to extract the field before the lookup

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...