Splunk Search

How to use eval and asterisk?

kiran331
Builder

Hi

How to use asterisk in the eval case search? I have to assign a value to the IP ranges.

for Ip range 1.2.* - Low
for Ip range 3.4.* - Medium
for IP range 5.* - High

I tried below search, its not working
search | eval case(src_ip=1.2.* , "Low", src_ip=3.4.* ,"Medium", src_ip=5.*. "High")

Tags (2)
0 Karma
1 Solution

woodcock
Esteemed Legend

Like this:

search | eval case(like(src_ip, "1.2.%"), "Low", like(src_ip, "3.4.%") ,"Medium", like(src_ip, "5._%.%"), "High")

View solution in original post

woodcock
Esteemed Legend

Like this:

search | eval case(like(src_ip, "1.2.%"), "Low", like(src_ip, "3.4.%") ,"Medium", like(src_ip, "5._%.%"), "High")

kiran331
Builder

Thank you!

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...