Hi there,
I am trying to push some puppet logs to cloudwatch logs from a Windows 2016 Ec2 instance. The puppet logs are stored in a text file in c:\logs\ directory. I have made following changes to the cloudwatch agent configuration file (showing only the important bits below) -
{
“IsEnabled”: true,
“EngineConfiguration”: {
“Components”: [
.
.
.
.
{
“Id”: “CustomLogs”,
“FullName”: “AWS.EC2.Windows.CloudWatch.CustomLog.CustomLogInputComponent,AWS.EC2.Windows.CloudWatch”,
“Parameters”: {
“LogDirectoryPath”: “C:\logs”,
“TimestampFormat”: “yyyy-MM-dd HH:mm:ss”,
“Encoding”: “UTF-8”,
“Filter”: “”,
“CultureName”: “en-US”,
“TimeZoneKind”: “Local”,
“LineCount”: “5”
}
},
{
“FullName”: “AWS.EC2.Windows.CloudWatch.CloudWatchLogsOutput,AWS.EC2.Windows.CloudWatch”,
“Id”: “CloudWatchLogs4”,
“Parameters”: {
“AccessKey”: “”,
“LogGroup”: “/my-app/puppet”,
“LogStream”: “{instance_id}”,
“Region”: “eu-west-1”,
“SecretKey”: “”
}
},
.
.
.
.
“Flows”: {
“Flows”: [
“CustomLogs, CloudWatchLogs4”
]
},
“PollInterval”: “00:00:30”
}
}
However it doesnt seem to work. I have tried restarting the SSM agent using the following command:
Restart-Service AmazonSSMAgent
But its not pushing the logs.
The cloudwatch agent is installed and running fine as its able to push the other windows related logs to cloudwatch. Its just this custom log from a text file which its not able to push.
Am I doing something wrong?
Thanks