Commit f415f1d
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-Logssection1 parent 6b38de4 commit f415f1d
File tree
2 files changed
+5
-1
lines changed- cookbooks/aws-parallelcluster-environment/files/cloudwatch
2 files changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
0 commit comments