Skip to content
Discussion options

You must be logged in to vote

Your approach of restoring the timestamp after conversion works. Use %+ to parse the RFC 3339 timestamp, including its Z timezone:

transforms:
  convert_s3:
    type: log_to_metric
    inputs: [s3_metrics_as_logs]
    metrics: []
    all_metrics: true

  restore_timestamp:
    type: remap
    inputs: [convert_s3]
    source: |
      .timestamp = parse_timestamp!(.tags.log_timestamp, "%+")

The Remote Write sink should consume restore_timestamp. The literal Z in your original format does not parse a timezone, so it can interpret the time using Vector's configured/default timezone. See parse_timestamp.

I tested this on Vector 0.60.0 with a local Vector Remote Write receiver. Your timestamp a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pront
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
transform:log_to_metric Anything `log_to_metric` transform related domain:metrics Anything related to Vector's metrics events sink:prometheus_remote_write Anything `prometheus_remote_write` sink related
2 participants