Splunk Search

Nested lookup search

g_paternicola
Path Finder

Hi everyone,  I'm trying to get the following search work, but for some reason I'm doing something wrong:

 

inputlookup events_lookup
| eval key = _key 
|search key in
[| inputlookup notable_events_lookup search name="tobedeleted" | fields - _time | fields event_id] 
|table key

 

I'm basically trying to import event_id from a lookup ( notable_events_lookup) which is matching to another lookup (evets_lookup) in order to remove the matching event in the lookup (events_lookup)

I hope it makes sense what I'm trying to explain. Thanks everyone

 

Labels (2)
0 Karma
1 Solution

aasabatini
Motivator

Hi @g_paternicola 

 

try this

inputlookup events_lookup
| eval key = _key 
| search [| inputlookup notable_events_lookup search name="tobedeleted" | fields - _time | rename event_id as key | fields key] 
|table key
“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”

View solution in original post

aasabatini
Motivator

Hi @g_paternicola 

 

try this

inputlookup events_lookup
| eval key = _key 
| search [| inputlookup notable_events_lookup search name="tobedeleted" | fields - _time | rename event_id as key | fields key] 
|table key
“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”

Taruchit
Contributor

Hi @aasabatini 

I have the below SPL: -

| inputlookup table1.csv where index="xxx" | fields index, host 
| search NOT [search index="xxx" | dedup host | table index, host]

I have table2.csv with following fields: -
index, host, lastTime

I need to search the results from above SPL based on host and index in table2.csv and get the corresponding value of the column: lastTime. Thus, as the final resultset, I need: - index, host,  lastTime. 

Please help with your suggestions. 

Thank you

0 Karma

g_paternicola
Path Finder

Thanks a lot! it works 🙂

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...