This page explains how to use the minif aggregation function in APL.
minif
aggregation in Axiom Processing Language (APL) allows you to calculate the minimum value of a numeric expression, but only for records that meet a specific condition. This aggregation is useful when you want to find the smallest value in a subset of data that satisfies a given predicate. For example, you can use minif
to find the shortest request duration for successful HTTP requests, or the minimum span duration for a specific service in your OpenTelemetry traces.
The minif
aggregation is especially useful in scenarios where you need conditional aggregations, such as log analysis, monitoring distributed systems, or examining security-related events.
Splunk SPL users
min
function in combination with where
to filter results. In APL, the minif
function combines both the filtering condition and the minimum calculation into one step.ANSI SQL users
CASE
statement with MIN
to apply conditional logic for aggregation. In APL, the minif
function simplifies this by combining both the condition and the aggregation.Parameter | Description |
---|---|
Expression | The numeric expression whose minimum value you want to find. |
Predicate | The condition that determines which records to include. |
minif
aggregation returns the minimum value of the specified Expression
for the records that satisfy the Predicate
.
geo.city | min_duration |
---|---|
San Diego | 120 |
New York | 95 |
200
status code, grouped by city.maxif
when you need the maximum value under a condition, rather than the minimum.