counterAsRate( ) Query Function

Calculates the rate for a counter field. This function can show the rate at which a counter changes. The result is returned in a field named _rate with the unit being “events/second”.

counterAsRate is often expected to be used as the function parameter in a timeChart() (or groupBy()). NOTE this function requires at least to two points for calculating a rate. When used in a timechart, it is important to have at least two points in each bucket to get a rate.

This function expects the field to have monotonic increasing values over time. If this is not the case no result is returned. Counters are often reset at server restarts or deployments. Running Rate over a reset, would not return a result. Using counterAsRate() in a timeChart() returns a rate for each buckets where the counter was not reset and nothing for the buckets where the counter was reset


Name Type Required Default Description
field string Yes field to extract a number from and calculate rate over
as string No _rate name of output field

field is the unnamed parameter.


Show the rate of a counter over time


Show the rate of a counter with one series for each host over time, displaying the rate as events per minute.

timechart(host, function=counterasrate(counter), unit="1/sec to 1/min")