aws / aws/amazon-cloudwatch-agent

timestamp_format is ignored

Open
#2,000 18 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
550
Forks
271
Avg merge
1d 21h
Merged PRs (30d)
13

Description

**Describe the bug**
Given standard high-precision syslog format and config: `"timestamp_format": "%Y-%m-%dT%H:%M:%S.%f+00:00"` and `"trim_timestamp": true`, the timestamp in CloudWatch Logs differs from the timestamp in the log message, and the timestamp isn't trimmed.

**Steps to reproduce**
```
{
"file_path": "/var/log/syslog",
"log_group_class": "STANDARD",
"log_group_name": "syslog",
"log_stream_name": "{instance_id}",
"retention_in_days": 30,
"timestamp_format": "%Y-%m-%dT%H:%M:%S.%f+00:00",
"trim_timestamp": true
},
```

**What did you expect to see?**
No timestamp in the `Message` field and the correct timestamp in the `Timestamp` field

**What did you see instead?**
The correct timestamp in the `Message` field, and an incorrect timestamp in the `Timestamp` field

**What version did you use?**
CWAgent/1.300064.0b1337 (go1.25.5; linux; arm64)

**What config did you use?**
As above

**Environment**
Ubuntu 24.04.2 LTS

**Additional context**

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.