Skip to content

Commit f415f1d

Browse files
committed
Fix incorrect timestamp parsing for chef-client.log in CloudWatch Agent
The CloudWatch Agent configuration was using the 'default' timestamp format (%Y-%m-%d %H:%M:%S,%f) for chef-client.log, but Chef/Cinc outputs timestamps in ISO 8601 format: [YYYY-MM-DDTHH:MM:SS+TZ]. This mismatch caused CloudWatch to fail parsing timestamps, resulting in log lines being associated with incorrect timestamps (often shifted by hours), which significantly complicated root cause analysis during incident investigations. Changes: - Add new 'chef' timestamp format: [%Y-%m-%dT%H:%M:%S (Note: CloudWatch Agent's %z only supports timezone without colon like -0700, but Chef outputs +02:00 format. We match up to seconds and let CloudWatch handle the rest.) - Update chef-client.log configuration to use the new 'chef' format Reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html\#CloudWatch-Agent-Configuration-File-Logssection
1 parent 6b38de4 commit f415f1d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ This file is used to list changes made in each version of the AWS ParallelCluste
2525
- Rdma-core: rdma-core-59.0-1
2626
- Open MPI: openmpi40-aws-4.1.7-2 and openmpi50-aws-5.0.8-11
2727

28+
**BUG FIXES**
29+
- Fix incorrect timestamp parsing for chef-client.log in CloudWatch Agent configuration. The timestamp format now correctly matches Chef's output format `[YYYY-MM-DDTHH:MM:SS+TZ]`.
30+
2831
3.14.0
2932
------
3033

cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"default": "%Y-%m-%d %H:%M:%S,%f",
55
"bracket_default": "[%Y-%m-%d %H:%M:%S]",
66
"slurm": "%Y-%m-%dT%H:%M:%S.%f",
7+
"chef": "[%Y-%m-%dT%H:%M:%S",
78
"json": ""
89
},
910
"log_configs": [
@@ -82,7 +83,7 @@
8283
"feature_conditions": []
8384
},
8485
{
85-
"timestamp_format_key": "default",
86+
"timestamp_format_key": "chef",
8687
"file_path": "/var/log/chef-client.log",
8788
"log_stream_name": "chef-client",
8889
"schedulers": [

0 commit comments

Comments
 (0)