02 Apr 2025 10:21 AM
Hello everyone,
I want to retrieve the total time of a time series for each service in order to produce a monthly report on the total degradation time per service.
Basic DQL query:
timeseries interval : 1h, health = avg(office365.tenant.service.health, filter : { status == ‘ serviceDegradation ’ }), by : { service }
Do you have any ideas on how to do this please?
Regards,
Solved! Go to Solution.
05 Apr 2025 07:29 PM - edited 05 Apr 2025 09:32 PM
Are you meaning like this?
timeseries by:{service}, filter:status == "serviceDegradation", interval:1h, timeframe:timeframe(from:now() - 30d, to:now()), health = avg(office365.tenant.service.health)
| fieldsAdd total_degradation_time = arraySum(health)
you can remove the timeframe if you will set it in the notebook section.
07 Apr 2025 09:14 AM
Hi Yanezza, thanks for your suggestion, I made the DQL query after my post finally, I forgot to close, thanks for your suggestion I created this query :
timeseries by:{service}, filter:status == $Statut, health = avg(office365.tenant.service.health)
| fieldsAdd health = arrayRemoveNulls(health)
| fieldsAdd total_time = toDuration(timeframe)
| filter isNotNull(total_time)
| fieldsAdd arraySize(health)
| fieldsAdd TempsduStatut=(`arraySize(health)`*interval)