Splunk Search

Error in 'lookup' command within Saved Searches

nicktate
Explorer

I've seen a few posts that talk about handling lookups from the back end or through uploading CSV's that don't really apply to my situation.

I've created a DBquery pull that draws in information into the lookup from a SQL database. I've written a few queries that connects to the lookup and have worked perfectly fine.

I'm attempting to run a lookup command within a saved search that has parameters that I'm passing through. I can execute the saved search manually, without passing parameter, perfectly fine. However, when I tried to execute the saved search and pass the parameters along I receive the "Error in 'lookup' command: Could not find all of the specified destination fields in the lookup table" statement.

Any thoughts or suggestions would be helpful, thank you!

| savedsearch "search_iris_ca_server_count" t_parent_businessname="Bus1" t_businessunit_businessname="Bus2"

Tags (2)

gkanapathy
Splunk Employee
Splunk Employee

It seems likely that the lookup definition is not exported (i.e., visible) in the app in which you're trying to run the saved search. The saved search on the other hand is visible. Perhaps when you run the saved search directly, you're in a different app. You can fix this by switching apps, or by setting the lookup to be global rather than app-specific.

0 Karma

nicktate
Explorer

Just double checked on the lookup definition and it is set as global for all apps so I don't think that is the problem. I tried removing the parameters from the saved search and running it again, just to try and get a saved search to execute but it still is giving me the error.

Has anyone successfully executed a lookup within a saved search?

0 Karma

nicktate
Explorer

index=summary source="Server_Inventory_v1.2"

Parent_Business="$t_parent_businessName$"
Business_Unit="$t_businessUnit_businessName$"
| lookup lookup_mappings.csv.gz serverID as serverID OUTPUT AppID
| stats
count(serverID) as Servers
count(eval(Is_Critical_Server="true")) as Critical_Servers
dc(AppID) as AppsOnServer by Parent_Business, Business_Unit
| table Business_Unit Servers Critical_Servers AppsOnServer

0 Karma

somesoni2
Revered Legend

Would you mind pasting the saved search in which you are using lookup?

0 Karma
Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...