Skip to content

around - Select events around a given timestamp

The around keyword allows users to declare a timerange, defined as some interval before and after a timestamp, on which a query should operate.

NOTE: The interval, if specified, MUST be positive.

Syntax

source (logs|spans) around <time> [interval <interval>]

NOTE: If the interval is not specified, then a default value of 30m is used.

Example - Basic usage

The around keyword can be used on logs or spans like so:

source logs around @'2021-01-01T00:00:00Z' interval 1h
source spans around @'2021-01-01T00:00:00Z' interval 1h

NOTE: The @ symbol before the timestamps indicates that these values are timestamp literals.

This particular query will source logs between @'2021-12-31T23:00:00Z' and @'2021-01-01T01:00:00Z'. In other words, one hour before the timestamp, to one hour after the timestamp.

Try it yourself

Open up your Coralogix explore screen and paste in the following query:

source logs around @'2024-10-14T00:00:00Z' interval 1h