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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...