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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...