Extract Day of Week Name From Timestamp

Get the name of the weekday from a timestamp using the time:dayOfWeekName() function

Query

logscale
time:dayOfWeekName(timestamp, as=weekday)

Introduction

The time:dayOfWeekName() function can be used to extract the English name of the weekday from a timestamp field. It returns the full name of the day (Monday through Sunday) as a string value.

In this example, the time:dayOfWeekName() function is used to extract the weekday name from a specific timestamp 2025-08-27 08:51:51.000, demonstrating how to get the day name from a datetime.

Step-by-Step

  1. Starting with the source repository events.

  2. logscale
    time:dayOfWeekName(timestamp, as=weekday)

    Extracts the name of the weekday from the @timestamp field and returns the result in a new field named weekday. If the as parameter is not specified, the result is returned in a field named _dayOfWeekName as default.

  3. Event Result set.

Summary and Results

The query is used to extract the weekday name from a timestamp, which is useful for creating human-readable output and reports.

This query is useful, for example, to generate readable reports, create user-friendly displays, or label data with weekday names.

Sample output from the incoming example data:

@timestampweekday
2025-08-27 08:51:51.000Wednesday

The result shows how the time:dayOfWeekName() function extracts the day name (in this case Wednesday) from the timestamp, returning it as a string value.

For visualizing this data, consider using a Bar Chart widget to show event counts by day name, or a Table widget to display events with their corresponding weekday names. The time:dayOfWeekName() function is often used with other time functions like time:month() and time:year() for complete date analysis.