Splunk Search

Outer join on lookup and subsearch timeout

ferofox
Engager

Hi all,

I am running into a timeout problem on one of my searches and now wanr to find out if there maybe is a better solution to my problem.

Task:
Take all values from a lookup table and search for their last appearance in the logs, but keep the remaining values as well.

Lookup-Table:
id,operator
123,OperatorA
234,OperatorB
345,OperatorC
[...]

Search:
sourcetype=id_log | fields id,source,timestamp | dedup id

Combined:
| inputlookup operator_lookup | join type=outer id [search sourcetype=id_log | fields id,source,timestamp | dedup id]
This search is running into a timeout issue:
[subsearch]: Search auto-finalized after time limit (60 seconds) reached.

Is there any other way to speed up the search, or at least to increase the timeout-value? Adding maxtime=600 to the join command does not work.

0 Karma
1 Solution

woodcock
Esteemed Legend

I think this will do it:

sourcetype=id_log | dedup id | fields id,source,timestamp  | eval type=search | append [ | inputlookup operator_lookup | eval type=lookup ] | stats values(*) AS * dc(type) AS numTypes by id | where type="lookup" OR numTypes=2

If my logic is wrong in the where part, just fix it to match the type of join you are trying to do.

View solution in original post

woodcock
Esteemed Legend

I think this will do it:

sourcetype=id_log | dedup id | fields id,source,timestamp  | eval type=search | append [ | inputlookup operator_lookup | eval type=lookup ] | stats values(*) AS * dc(type) AS numTypes by id | where type="lookup" OR numTypes=2

If my logic is wrong in the where part, just fix it to match the type of join you are trying to do.

ferofox
Engager

Allright, thank you! This totally did the trick! I changed the where part a bit, and now it gives the exact results I expected.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...