Create Analytics Metrics From Scheduled Queries

This page describes how to create analytics metrics from scheduled queries.

If you want to execute an analytics search repeatedly to monitor its value, you can create a metric from the search. The search will execute once per minute and report the results as a metric. You can create alerts on the metric in the usual way using Health Rules to trigger Policies and Actions. The analytics metric list is searchable.

You can create metrics for all Analytics event types - Browser, Mobile, Transaction, Log, and Custom.

Note: Although the metrics calculated by scheduled queries may have decimal point precision, we only save and report whole numbers.

You can create a metric from an analytics search for the functions shown in this table. SeeMetric Data Resolution over Time.

FunctionMetric Rollup TypeExample
count(* | field_name)sumSELECT count( activeMacUsers) FROM dummyTransactions

distinctcount(field_name)

averageSELECT distinctcount(activeMacUsers) FROM dummyTransactions

sum(numeric_field_name)

sumSELECT sum(responseTime)where userExperience = "NORMAL" FROM transactions

avg(numeric_field_name)

average

SELECT avg(responseTime) FROM transactions
min(numeric_field_name)

average

SELECT min(responseTime) FROM transactions

max(numeric_field_name)

average

SELECT max(responseTime) FROM transactions
(exp1)/(exp2)average

SELECT (count(activeMacUsers)) / (avg(activeWindowsUsers)) FROM dummyTransactionsSELECT (avg(responseTime)*2)/((avg(segments.transactionTime)+3)/2) FROM transactionsSELECT (sum(responseTime)*2)/(filter(sum(responseTime), where userExperience = "NORMAL") + 0.5) FROM transactions

Note: Each side of the expression must be enclosed in parenthesis.
Attention: You must have Manage Metrics permission and View access to Analytics to create metrics from analytics searches. See

Analytics and Data Security

and Transaction Analytics Permissions .