DQL
Questions about Dynatrace Query Language
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need help to filter data according to time range in DQL

ravi_singh
Visitor

timeseries terminal_up = max(httpcheck.status),
filter: { host.type == "terminal" and http.status_class == "2xx" },
by: { hostName = host.name, storeId = store.name },
interval: 1m
| fieldsAdd is_up = if(terminal_up[] > 0, 1, else: 0)
| fieldsAdd availability_pct = arrayAvg(is_up) * 100
| fields storeId, hostName, availability_pct


IN THIS QUERY I WANT TO CALCULATE AVAILABILITY PERC ONLY CONSIDERING DATA BETWEEN 6AM ET TO 11PM ET HOW TO DO IT , PLEASE HELPPPPPPPPPPPPPPP

 

1 REPLY 1

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

You can try to add:

from:toTimestamp("T06:00:00"), to:toTimestamp("T23:00:00")

It means:

timeseries terminal_up = max(httpcheck.status), from:toTimestamp("T06:00:00"), to:toTimestamp("T23:00:00"),
filter: { host.type == "terminal" and http.status_class == "2xx" },
by: { hostName = host.name, storeId = store.name },
interval: 1m
| fieldsAdd is_up = if(terminal_up[] > 0, 1, else: 0)
| fieldsAdd availability_pct = arrayAvg(is_up) * 100
| fields storeId, hostName, availability_pct

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Featured Posts