autoregress
Use the autoregress command to create lagged (previous-row)
copies of a field's values. This is the lag/lead equivalent for
CloudWatch Logs Insights.
Syntax
| autoregressfield[ASalias] [p=start[-end]]
The command uses the following arguments:
-
– The field to create lag values for.field -
AS(Optional) – An alias for the output field.alias -
p=(Optional) – Single lag depth (default 1). UseNp=for a range of lags.N-M
Example
The following query creates four lag fields
(bytes_p1 through bytes_p4).
fields @timestamp, bytes | autoregress bytes p=1-4