cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Average of 2 arrays by a field

elenaperez
Dynatrace Contributor
Dynatrace Contributor

Hi team,

Having the following query:

timeseries value = avg(dt.cloud.azure.vm.cpu_usage), by: {azure.location, azure.management_group, azure.resource.name, azure.subscription, azure.vm_scale_set.name, dt.entity.azure_region, dt.entity.azure_vm, dt.source_entity, dt.source_entity.type}
| filter contains(azure.resource.name, "primary00") or contains(azure.resource.name, "primary01")
| parse azure.resource.name, "LD 'primary0' INT:number"

I'd like to get in a timeseries the average of the arrays by number. Meaning, for all arrays with number==0, an average of the values of the arrays and the same for number==1.

How could I achieve this? arrayAvg doesn't seem to work for this use case.

Thanks in advance!

0 REPLIES 0

Featured Posts