Splunk Search

How to edit my search to display "VPN UP" or "VPN DOWN" based on the result of a field value?

jd
Explorer

Hy,

I'm searching to monitor my VPN. I found a way to search the latest values of my field "vpntype" in the last 2 minutes. If my vpntype =ipsec-static, then my vpn is UP. If it is blank, my VPN is down :

host="172.10.0.28" vpntype="ipsec-static" | stats latest(vpntype)

Can i have a way to display "VPN UP" instead of the vnptype values ?

Thanks.

1 Solution

Patient
Path Finder

Hi,
try with:

host="172.10.0.28" vpntype="ipsec-static" | stats latest(vpntype) as val|eval  latest_vpntype=if(vpntype=="ipsec-static", "VPN UP", val)| table latest_vpntype

View solution in original post

Patient
Path Finder

Hi,
try with:

host="172.10.0.28" vpntype="ipsec-static" | stats latest(vpntype) as val|eval  latest_vpntype=if(vpntype=="ipsec-static", "VPN UP", val)| table latest_vpntype

jd
Explorer

Great !! Thanks.

0 Karma

Patient
Path Finder

Thank for your vote.

0 Karma

satishsdange
Builder

Hi -
Please try below -
your base search | eval VPN_Status=case(vpntype==ipsec-static, "VPN UP", vpntype!=ipsec-static, "VPN DOWN")

0 Karma

jd
Explorer

Hy,

Thanks. I try it but don't works. my visualisation is "ipsec-static".

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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