This page explains how to use the arg_min aggregation in APL.
arg_min
aggregation in APL allows you to identify the row in a dataset where an expression evaluates to the minimum value. You can use this to retrieve other associated fields in the same row, making it particularly useful for pinpointing details about the smallest value in large datasets. If you group your data, arg_min
finds the row within each group where a particular expression evaluates to the minimum value.
This aggregation is particularly useful in scenarios like the following:
Splunk SPL users
arg_min
. You can use stats
with a combination of values
and first
clauses to evaluate the minimum value of a single numberic field. APL provides a dedicated arg_min
aggregation that evaluates expressions.ANSI SQL users
MIN
, GROUP BY
, and JOIN
to retrieve the associated fields. APL’s arg_min
eliminates the need for multiple steps by directly returning the row with the minimum value.expression
: The expression to evaluate for the minimum value.field1, ..., fieldN
: Additional fields to return from the row with the minimum value.arg_min
to identify the path with the shortest duration and its associated details for each method.Queryreq_duration_ms | uri | method |
---|---|---|
0.1 | /api/login | POST |