# Prometheus data filtered by duration

**URL:** <https://community.grafana.com/t/prometheus-data-filtered-by-duration/129169>\
**Category:** Prometheus\
**Tags:** exporter, promethues\
**Created:** [August 21, 2024, 11:28am UTC](https://community.grafana.com/t/prometheus-data-filtered-by-duration/129169 "2024-08-21T11:28:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![calaneo](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@calaneo](https://community.grafana.com/u/calaneo)\
**Post date:** [August 21, 2024, 11:28am UTC](https://community.grafana.com/t/prometheus-data-filtered-by-duration/129169/1 "2024-08-21T11:28:15Z")

</div>

Hi there,

we’re using Grafana together with Prometheus and windows\_exporter on our Remote Desktop Session hosts to monitor a lot of different things.

Altough I’ve already set up a dozen dashboards, I currently can’t figure out how I can achieve to display a table only showing those users, whose sessions are disconnected for at minimum 2 hours in one piece within a selected timeframe.

The windows\_exporter metric we already have a timeline set up with to filter the disconnected users, is (for example):

windows\_terminal\_services\_session\_info{instance=~“rds._", state=“disconnected”, user=~"domain._”} == 1

Can someone take me by the hand how to accomplish the goal?

Regards,  
Andreas
