Documentation

Timestamp Processor Plugin

This plugin allows to parse fields containing timestamps into timestamps of other format.

Introduced in: Telegraf v1.31.0 Tags: transformation OS support: all

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

# Convert a timestamp field to other timestamp format
[[processors.timestamp]]
  ## Timestamp key to convert
  ## Specify the field name that contains the timestamp to convert. The result
  ## will replace the current field value.
  field = ""

  ## Timestamp Format
  ## This defines the time layout used to interpret the source timestamp field.
  ## The time must be `unix`, `unix_ms`, `unix_us`, `unix_ns`, or a time in Go
  ## "reference time". For more information on Go "reference time". For more
  ## see: https://golang.org/pkg/time/#Time.Format
  source_timestamp_format = ""

  ## Timestamp Timezone
  ## Source timestamp timezone. If not set, assumed to be in UTC.
  ## Options are as follows:
  ##   1. UTC                 -- or unspecified will return timestamp in UTC
  ##   2. Local               -- interpret based on machine localtime
  ##   3. "America/New_York"  -- Unix TZ values like those found in
  ##        https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  # source_timestamp_timezone = ""

  ## Target timestamp format
  ## This defines the destination timestamp format. It also can accept either
  ## `unix`, `unix_ms`, `unix_us`, `unix_ns`, or a time in Go "reference time".
  destination_timestamp_format = ""

  ## Target Timestamp Timezone
  ## Source timestamp timezone. If not set, assumed to be in UTC.
  ## Options are as follows:
  ##   1. UTC                 -- or unspecified will return timestamp in UTC
  ##   2. Local               -- interpret based on machine localtime
  ##   3. "America/New_York"  -- Unix TZ values like those found in
  ##        https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  # destination_timestamp_timezone = ""

Example

Convert a timestamp to unix timestamp:

[[processors.timestamp]]
  source_timestamp_field = "timestamp"
  source_timestamp_format = "2006-01-02T15:04:05.999999999Z"
  destination_timestamp_format = "unix"
- metric value=42i,timestamp="2024-03-04T10:10:32.123456Z" 1560540094000000000
+ metric value=42i,timestamp=1709547032 1560540094000000000

Convert the same timestamp to a nanosecond unix timestamp:

[[processors.timestamp]]
  source_timestamp_field = "timestamp"
  source_timestamp_format = "2006-01-02T15:04:05.999999999Z"
  destination_timestamp_format = "unix_ns"
- metric value=42i,timestamp="2024-03-04T10:10:32.123456789Z" 1560540094000000000
+ metric value=42i,timestamp=1709547032123456789 1560540094000000000

Convert the timestamp to another timestamp format:

[[processors.timestamp]]
  source_timestamp_field = "timestamp"
  source_timestamp_format = "2006-01-02T15:04:05.999999999Z"
  destination_timestamp_format = "2006-01-02T15:04"
- metric value=42i,timestamp="2024-03-04T10:10:32.123456Z" 1560540094000000000
+ metric value=42i,timestamp="2024-03-04T10:10" 1560540094000000000

Was this page helpful?

Thank you for your feedback!


New in InfluxDB 3.5

Key enhancements in InfluxDB 3.5 and the InfluxDB 3 Explorer 1.3.

See the Blog Post

InfluxDB 3.5 is now available for both Core and Enterprise, introducing custom plugin repository support, enhanced operational visibility with queryable CLI parameters and manual node management, stronger security controls, and general performance improvements.

InfluxDB 3 Explorer 1.3 brings powerful new capabilities including Dashboards (beta) for saving and organizing your favorite queries, and cache querying for instant access to Last Value and Distinct Value caches—making Explorer a more comprehensive workspace for time series monitoring and analysis.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On November 3, 2025, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2