Splunk Search

Search Question

Kendo213
Communicator

I'm building out a dashboard to identify VPN issues in our environment. The issue with the search below is that those failed VPN sessions do not have tunnel IDs, however successful VPN connections do. This results in 'no results found' for failed connections because there is no tunnel ID. If I 'fillnull tunnelid' the results in successful transactions having a null value generated in each set of results which shows an issue where one did not exist, while fixing the sessions that are failed. Any ideas? I'm not sure how to do a stats by a field that may or may not exist, and the fillnull creates misleading results. A session can have multiple tunnels throughout the day which is why I'm attempting to go down this road.

index=indexa sourcetype="sourcetype" SESSION_ID=$sessionid$ AND field9=* AND message=* AND message!=Session*
| dedup _raw
| rex field=message "(?<tunnelid>0x[0-9a-fA-F]{12})"
|fillnull tunnelid VALUE="No Tunnel"
| stats earliest(eval(field9=="Received User-Agent header")) as start latest(eval(like(field9,"%started%"))) as connect latest(eval(like(field9,"%closed%"))) as closed latest(eval(like(field9,"%unknown%"))) as unknownerrors latest(eval(like(field9,"%PPP%"))) as tunnels by SESSION_ID,tunnelid
| eval success=if(connect=1,1,0)
| eval closed=if(isnull(closed),0,1)
| eval errors=if(isnull(unknownerrors),0,1)
| eval Status=case(success=1 AND closed=0,"VPN Currently Connected",closed=1 AND errors=0,"VPN Connected Successfully & User Logged Off",errors=1,"VPN Connected Successfully & Encountered Issues",1=1,"Connection was not successful")
| rename SESSION_ID as "Session ID" tunnelid as "Tunnel ID"
| table "Session ID","Tunnel ID",Status
Tags (1)
1 Solution

Kendo213
Communicator

And as soon as I posted this, i found the command 'filldown'. This resolved my issue.

Thanks

View solution in original post

Kendo213
Communicator

And as soon as I posted this, i found the command 'filldown'. This resolved my issue.

Thanks

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...