Splunk Search

Lookup table not giving results.

neonmonarch
Engager

Hi all,

I've trying to establish a lookup table that is used in a query (query below). I've setup the lookup table in Defintions & Files. When I run the query, I get matching events but with 0 results.

I have the index, time range and status details. Have removed company specific information.

| eval srcip=dstip
| lookup lt1 cidr_value AS srcip OUTPUT network AS srcnet, cidr_value AS srccidr 

| replace internal_private WITH "Internal private" IN srcnet
| replace internal_public WITH "Internal public" IN srcnet
| replace Unknown WITH "Uknown" IN srcnet

| eval srccidr=if(srccidr="Unknown", srcip, srccidr)

| stats c(id) AS "# incidents", values(srcnet) AS "netid" by srccidr
| eval net=replace(srccidr, "\/+", "")
| geoip net 
| table srccidr netid net_country_name "# incidents"
| rename srccidr AS "Network", netid AS "Classification", net_country_name AS "Origin"
| sort 15 - "# incidents"
| fillnull value="-"

If anyone has some ideas on how to produce results.

Thanks

Tags (1)
0 Karma
1 Solution

ShaneNewman
Motivator

If you run the search all the way to your stats command, then table id, srcnet and srccidr; do you get results for all of the fields? If there are no values for srccidr, there cannot be any stats done on it...

View solution in original post

ShaneNewman
Motivator

If you run the search all the way to your stats command, then table id, srcnet and srccidr; do you get results for all of the fields? If there are no values for srccidr, there cannot be any stats done on it...

ShaneNewman
Motivator

Glad I could help!

0 Karma

neonmonarch
Engager

You deserve a cookie! Thank you very much.

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!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

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 ...