Splunk Search

How To Filter IP Field Using Subnet Value Stored In Variable

joemarty82
Explorer

Hello,

 

I am trying to create a drill down dashboard. Basically I want to pass a subnet value (which is currently represented as a string) from one pane to another search pane and search on data in that query using the subnet value. I have tried several methods and none seem to work.

 

Ideally I thought something like the below would work in pseudo code.

 

Search ... |
eval subnet_value=$subnet value from first query$ |
where ipv4=subnet_value 

 

However, I get back no results. Perhaps someone has some tips on some things I can try next as I am stuck currently.

 

Thanks in advance,

Joe

Labels (1)
0 Karma

thambisetty
SplunkTrust
SplunkTrust

how are you passing your subnet value?

can you share example subnet value?

you can't compare ipv4 with subnet (for example 10.10.10.0/24) as you mentioned in your pseudo code 

where ipv4=subnet_value

instead, you get value to current search from other dashboard ( I believe your subnet value coming from dashboard would be something like 10.10.10.0/24 ). you can write this value to lookup using outputlookup command from current search. define lookup where lookup can match cidr for specified field.

and then you have to use lookup command instead of where like above.

————————————
If this helps, give a like below.
0 Karma
Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

  Ready to master Kubernetes and cloud monitoring like the pros?Join Splunk’s Growth Engineering team for an ...

Wrapping Up Cybersecurity Awareness Month

October might be wrapping up, but for Splunk Education, cybersecurity awareness never goes out of season. ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...