# How to get the realtime data based on aggrgations

**URL:** <https://discuss.elastic.co/t/how-to-get-the-realtime-data-based-on-aggrgations/268787>\
**Category:** Elasticsearch\
**Created:** [March 30, 2021, 12:21pm UTC](https://discuss.elastic.co/t/how-to-get-the-realtime-data-based-on-aggrgations/268787 "2021-03-30T12:21:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjilinga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anjilinga/32/86010_2.png) [@anjilinga](https://discuss.elastic.co/u/anjilinga)\
**Post date:** [March 30, 2021, 12:21pm UTC](https://discuss.elastic.co/t/how-to-get-the-realtime-data-based-on-aggrgations/268787/1 "2021-03-30T12:21:23Z")

</div>

Hi,  
With the below data, want to measure the time series graph with 30 sec resolution, how many are logged in and how many are Ready and how many are Busy. how to group by agent and find the status and sum the agents based on the status at every 30 sec time intervel  
Time Agent Status  
9:10 agent1 Login  
9:20 agent2 Login  
9:30 agent1 Busy  
9:35 agent1 Ready  
9:36 agent1 Logout  
9:40 agent2 Ready  
9:44 agent3 Login  
9:45 agent4 Login

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [March 30, 2021, 10:32pm UTC](https://discuss.elastic.co/t/how-to-get-the-realtime-data-based-on-aggrgations/268787/2 "2021-03-30T22:32:51Z")

</div>

1. You dont have seconds in your timestamp, hence it does not make any sense to use 30 seconds interval.
2. What have you tried? What error/issue have you encountered?  
Cheers!

---

<div class="post-metadata">

**Author:** ![anjilinga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anjilinga/32/86010_2.png) [@anjilinga](https://discuss.elastic.co/u/anjilinga)\
**Post date:** [March 31, 2021, 7:14am UTC](https://discuss.elastic.co/t/how-to-get-the-realtime-data-based-on-aggrgations/268787/3 "2021-03-31T07:14:43Z")

</div>

Hi,  
I have just given the reference data. we can try for each miniute with above data. what is the approch to get the stats for every minute.

as the agent1 is login at 9:10 it should count at 9:11 and 9:12 and 9:13 also as he still login.

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [March 31, 2021, 10:08pm UTC](https://discuss.elastic.co/t/how-to-get-the-realtime-data-based-on-aggrgations/268787/4 "2021-03-31T22:08:53Z")

</div>

> **[Line, Area, and Bar charts | Kibana Guide \[6.8\] | Elastic](https://www.elastic.co/guide/en/kibana/6.8/xy-chart.html)**

---

<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:** [April 28, 2021, 10:09pm UTC](https://discuss.elastic.co/t/how-to-get-the-realtime-data-based-on-aggrgations/268787/5 "2021-04-28T22:09:39Z")

</div>

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