Dashboards & Visualizations

Streamed search execute failed because: Error in 'lookup' command: Could not construct lookup

Varsha1
Explorer

Hi All,

I'm facing issue while appending results for 2 searches using append command. 

I have a 2 search which i'm using to get results and also both query has lookup command to get ip_address details from a lookup .

Search query1: index=abc filter1=A | eval ..| table * | lookup def host as host OUTPUT ipaddress | stats ..| eval ..

Query 2: index=abc filter2=B | eval ..| table * | lookup def host as host OUTPUT ipaddress | stats ..| eval ..

Both searches are almost same except "filter" field and eval commands. And i'm using append command to append results as below:

index=abc filter1=A | eval ..| table * | lookup def host as host OUTPUT ipaddress | stats ..| eval ..| append [search index=abc filter2=B | eval ..| table * | lookup def host as host OUTPUT ipaddress | stats ..| eval ..]

I'm getting error ([subsearch]: Streamed search execute failed because: Error in 'lookup' command: Could not construct lookup) when running above query and runs fine if i run it seperately.

Please let me know what i am making wrong.

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Consider moving the lookup command to after the append.

index=abc filter1=A 
| eval ..
| table * 
| stats ..
| eval ..
| append [search index=abc filter2=B 
  | eval ..| table * 
  | stats ..
  | eval ..
]
| lookup def host as host OUTPUT ipaddress 

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

starcher
SplunkTrust
SplunkTrust

Most often that message happens when the csv behind the lookup definition is missing. Check that.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Consider moving the lookup command to after the append.

index=abc filter1=A 
| eval ..
| table * 
| stats ..
| eval ..
| append [search index=abc filter2=B 
  | eval ..| table * 
  | stats ..
  | eval ..
]
| lookup def host as host OUTPUT ipaddress 

 

---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

I wish I had an explanation.  You'd have to look at the search log for the failing search to see how that error is triggered.

Moving the lookup call was mainly a shot in the dark, but also should be more efficient by doing the lookups after the number of events have been reduced by stats.

---
If this reply helps you, Karma would be appreciated.
0 Karma

Varsha1
Explorer

@richgalloway , It is working fine when i used it at the end.  can you explain the logic behind it please. 

Thank you so much for the answer !!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Subsearches are limited to 50,000 events. Could this be your issue? Could you try with smaller timeframes?

0 Karma

Varsha1
Explorer

I'm running it for last 60min and it is below 50000 events only

 

0 Karma
Get Updates on the Splunk Community!

Build Scalable Security While Moving to Cloud - Guide From Clayton Homes

 Clayton Homes faced the increased challenge of strengthening their security posture as they went through ...

Mission Control | Explore the latest release of Splunk Mission Control (2.3)

We’re happy to announce the release of Mission Control 2.3 which includes several new and exciting features ...

Cloud Platform | Migrating your Splunk Cloud deployment to Python 3.7

Python 2.7, the last release of Python 2, reached End of Life back on January 1, 2020. As part of our larger ...