# How to visualize user login

**URL:** <https://discuss.elastic.co/t/how-to-visualize-user-login/339280>\
**Category:** Kibana\
**Created:** [July 26, 2023, 9:14am UTC](https://discuss.elastic.co/t/how-to-visualize-user-login/339280 "2023-07-26T09:14:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![frh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frh/32/123902_2.png) [@frh](https://discuss.elastic.co/u/frh)\
**Post date:** [July 26, 2023, 9:14am UTC](https://discuss.elastic.co/t/how-to-visualize-user-login/339280/1 "2023-07-26T09:14:51Z")

</div>

Hi,  
I'm trying to figure out the number of user logins in certain instance. The reason being is I want to see how many users have logged in to instance ABC and who are the users logged in to instance ABC.

Thank you.

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [July 27, 2023, 2:11pm UTC](https://discuss.elastic.co/t/how-to-visualize-user-login/339280/2 "2023-07-27T14:11:30Z")

</div>

Can you give me a bit more information?  
First, are you talking about user login events from your application or user login event in Kibana?  
Second, are these events logged in Elasticsearch? if so can you see them at least in Kibana Discover?  
If so, the answer is easy: open the navigation menu, go to visualize, Create visualization, Lens and from there drag and drop the first field on the right field list called "Records" to the chart. This will create a time series chart that counts the number of events you have ingested. Second you need to add a filter to the top bar to filter only the events related to a login (you will probably have ingested your events with some tag that specify if this is a login/logout etc event).

This is a basic explanation but I can give more guidance if you can describe better your current situation and system status

---

<div class="post-metadata">

**Author:** ![frh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frh/32/123902_2.png) [@frh](https://discuss.elastic.co/u/frh)\
**Post date:** [July 28, 2023, 7:05am UTC](https://discuss.elastic.co/t/how-to-visualize-user-login/339280/3 "2023-07-28T07:05:48Z")

</div>

Hi Marco,  
To answer your questions:

First, are you talking about user login events from your application or user login event in Kibana?

- user login event from my application specifically from certain instance/host

Second, are these events logged in Elasticsearch? if so can you see them at least in Kibana Discover?

- there is custom field saying that user xxxx logged in and there is another field displayed which instance that user logged in to

"therest": "User 'xxxx' logged in with concurrent ALM"  
"hostname": "SL-yyyyy"

I'm not sure if these currents fields are sufficient to create Visualization. Basically I just wanna see how many users have logged into certain instance for example weekly or monthly just to see the pattern of login frequencies.

Thank you.

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [July 31, 2023, 7:50am UTC](https://discuss.elastic.co/t/how-to-visualize-user-login/339280/4 "2023-07-31T07:50:38Z")

</div>

This is definitely doable.  
By opening following this guide [Create visualizations with Lens | Kibana Guide [8.9] | Elastic](https://www.elastic.co/guide/en/kibana/current/lens.html) you can definitely have an idea on how to operate in Lens and start displaying your data.  
Initially you can just Open Lens, and drag a timestamp field to the chart area. This will display the overall count of document (related to the index/dataview shown in the top left dropdown menu) ingested in ES. if you wan to narrow this down to only documents related to your user logged, you should add a filter/query in the query bar that specify the field and the value that describe a login event. That way you are visualizing count of login events on your time frame.  
Finally if you also drag the `hostname` field to the `breakdown` panel to the right, you will see a set of series per each host with the count of login events in your time frame.  
I hope this helps

 ![Screenshot 2023-07-31 at 09.55.02](https://us1.discourse-cdn.com/elastic/original/3X/c/8/c8bfb0c45d666a2e889da1c623aad967b0fd5776.jpeg)

---

<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:** [August 28, 2023, 7:51am UTC](https://discuss.elastic.co/t/how-to-visualize-user-login/339280/5 "2023-08-28T07:51:24Z")

</div>

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