Splunk Search

VPN count

dmenon
Explorer

Hi - We want to get users connected in 1 hour. When a user connects we get event_id="globalprotectgateway-auth-succ" in logs and when they disconnect then event_id is event_id="globalprotectgateway-logout-succ" . Each login in and logout should be counted as 1 event per hour but sometimes user just remains logged in and there is no logout even in that case we want the user to be counted as logged in user since they haven't logged out.

(index=firewall OR index=cloud_firewall) eventtype="pan_system" log_subtype="globalprotect" sourcetype="pan:system" ( event_id="globalprotectgateway-auth-succ" OR event_id="globalprotectgateway-logout-succ" OR "globalprotectportal-gencookie-succ") | eval logins = strftime(_time,"%H") | transaction user startswith="globalprotectgateway-auth-succ" endswith= "globalprotectgateway-logout-succ" | stats values(user), distinct_count(user) by logins

This works fine with login and logout for every 60 mins but if there is a user session that has not logged out then that user doesnt get counted in hourly user count.

Tags (3)
0 Karma

to4kawa
Ultra Champion
0 Karma

woodcock
Esteemed Legend

You need the concurrency command. See here for an example similar to your use-case which you should be able to adapt:
https://answers.splunk.com/answers/319585/how-to-graph-the-number-of-active-sessions-over-ti.html

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...