Splunk Search

Assistance with Lookup / Search Query

CyberCyberSec
Loves-to-Learn

I am trying to run a query where it compares a search result field against a field in the lookup table. I was able to get it working, but then I am trying to also show the corresponding field with that object that is located in the lookup table.

 

This is what I have so far

index=zscaler sourcetype="zscaler:syslog:zscaler_web_policy"
[| inputlookup "riskiq_last_status"
| return 1000 $name]
|table url status

It is just matching the name field in the lookup table to the url field in the index search query. I am guessing the status field is blank because there isnt a status field in the index search results....

How do I add a a field in the lookup table to the search query results?

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You are using the lookup as a filter to the outer search. If you want to add fields to the data reported, then you use the lookup as a lookup, i.e.

| lookup riskiq_last_status name as url OUTPUT status

Hope this helps

 

0 Karma

CyberCyberSec
Loves-to-Learn

Thanks for the reply,

 

I tried that and I still get nothing in the status, the only thing I can think of is that the data in the url field doesnt exactly match what is in the lookup table.

 

Lookup table value = carecredit.citymaps.com

Search field value = carecredit.citymaps.com/

 

Is there a way to do a contains lookup instead of a exact match?

Tags (1)
0 Karma

CyberCyberSec
Loves-to-Learn

I did a eval and trimmed the / at the end before it did the lookup function and it returns the monitor now.

 

The question is now how can I do a wildcard lookup because this is doing a exact lookup on the status field.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can add the * character to the value of the field in the lookup file and in the advanced options part of the  lookup definition for that lookup, make that field a wildcard field in the match type, e.g. WILDCARD(name)

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...