Extract Minute From Timestamp

Get the minute from a timestamp using the time:minute() function

Query

flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 1["Expression"] result{{Result Set}} repo --> 1 1 --> result
logscale
time:minute(timestamp, as=minute)

Introduction

The time:minute() function can be used to extract the minute (0-59) from a timestamp field. It returns the minute as an integer value representing the minutes within the hour.

In this example, the time:minute() function is used to extract the minute from a specific timestamp 2025-08-27 08:51:51.312, demonstrating how to get the minute value from a datetime.

Step-by-Step

  1. Starting with the source repository events.

  2. flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 1["Expression"] result{{Result Set}} repo --> 1 1 --> result style 1 fill:#ff0000,stroke-width:4px,stroke:#000;
    logscale
    time:minute(timestamp, as=minute)

    Extracts the minute from the @timestamp field and returns the result in a new field named minute. If the as parameter is not specified, the result is returned in a field named _minute as default.

  3. Event Result set.

Summary and Results

The query is used to extract the minute from a timestamp, which is useful for analyzing events at a minute-level granularity.

This query is useful, for example, to analyze per-minute patterns, group events by minute, or investigate timing patterns within hours.

Sample output from the incoming example data:

@timestampminute
2025-08-27 08:51:51.31251

The result shows how the time:minute() function extracts the minute (in this case 51) from the timestamp, indicating it is 51 minutes past the hour.

For visualizing this data, consider using a Bar Chart widget to show event distribution across minutes, or a Heat Map widget to display activity patterns within hours. The time:minute() function is often used with other time functions like time:hour() and time:second() for detailed time analysis.