Getting Data In

How to use Lookup table to analyze events?

waJesu
Path Finder

I created a lookup table for blacklisted DNS queries. I need a query that uses the lookup table to see if domains in the lookup table are present in events in my environment. 

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Assuming you have a "domain" field in both the lookup file and an index, this should get you started.

index=foo [ | inputlookup denieddomains.csv | field domain | format ]

The subsearch (inside square brackets) fetches the contents of the lookup table (I made up a name - replace it with your own), extracts only the "domain" field, then formats the results into a search string which is then returned to the main search for execution.

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

waJesu
Path Finder

I tried this and it did not return results.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

This is a bit vague.

What fields and values do you have in your lookup table?

What corresponding fields do you have in your events?

0 Karma

waJesu
Path Finder

The lookup table has a single field "DNS" with all the blocklisted dns requests e.g. bliss.com, sugar.plux.net etc.. The corresponding field in the events could be dns_queries

0 Karma

waJesu
Path Finder

I meant dns_query

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=foo [ | inputlookup denieddomains.csv | field DNS | rename DNS as dns_query | format ]

waJesu
Path Finder

It worked. Thank you very much. May you please explain to me what each part of the query does so that next time I can create personal queries of the same kind.

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The subsearch retrieves the DNS names from the lookup and renames the field so that it matches the field name used in the events. The format essentially expands to something like this 

index=foo (( dns_query="value1") OR (dns_query="value2"))

waJesu
Path Finder

Thank you. I really appreciate.

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!

Mastering Threat Intelligence in ES 8.5, Splunk AI Assistant v2, and More from Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Break the Build: Inside the KubeDoom Lounge at .conf26

    You step up to the machine. The pixelated corridors of a certain 1993 FPS load in front of you, EMP Pulse ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...