Skip to content

timestamp_format is ignored #2000

@davidjmemmett

Description

@davidjmemmett

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions