# How to get connected vpn users

**URL:** <https://discuss.elastic.co/t/how-to-get-connected-vpn-users/98039>\
**Category:** Elasticsearch\
**Created:** [August 23, 2017, 9:37am UTC](https://discuss.elastic.co/t/how-to-get-connected-vpn-users/98039 "2017-08-23T09:37:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schlum](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@schlum](https://discuss.elastic.co/u/schlum)\
**Post date:** [August 23, 2017, 9:37am UTC](https://discuss.elastic.co/t/how-to-get-connected-vpn-users/98039/1 "2017-08-23T09:37:50Z")

</div>

Hi,

I am new to ELK and cannot find the good way to do the following (neither the keywords to search the documentation...) :

I have an index with my ASA VPN logs.

When a user connect we get a "login" log and a "logout" log when they disconnect.

I try to make a query to get all connected users.

It seems to me that I need to build a query looking for the "login" logs where there is no "logout" logs afterward yet.  
(the id to identify each log would be the username&IP of the user).

Is it possible to build such a query with elasticsearch ?

I would really appreciate if someone could tell me in what direction to look in the documentation.

Best Regards,  
Jérôme

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [August 23, 2017, 10:28am UTC](https://discuss.elastic.co/t/how-to-get-connected-vpn-users/98039/2 "2017-08-23T10:28:45Z")

</div>

See [List the active users using login and logged out events](https://discuss.elastic.co/t/list-the-active-users-using-login-and-logged-out-events/96724/6?u=mark_harwood)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 20, 2017, 10:28am UTC](https://discuss.elastic.co/t/how-to-get-connected-vpn-users/98039/3 "2017-09-20T10:28:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
