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!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...