I have a Windows EC2 machine running legacy software and a need to sync file logs from it to CloudWatch.
Relevant configuration in AWS.EC2.Windows.CloudWatch.json
is as follows:
...
{
"FullName": "AWS.EC2.Windows.CloudWatch.CustomLog.CustomLogInputComponent,AWS.EC2.Windows.CloudWatch",
"Id": "LegacyLogs",
"Parameters": {
"CultureName": "en-US",
"Encoding": "UTF-8",
"Filter": "*.log",
"LineCount": "10",
"LogDirectoryPath": "C:\\Program Files\\LegacyApp\\log\\",
"TimeZoneKind": "Local",
"TimestampFormat": "HH:mm:ss"
}
},
...
Legacy software outputs log file starting with empty line followed by time:
14:09:37 * Open log file
on 'WHATEVER'
When empty line is removed log will sync to CloudWatch. Otherwise, file is silently ignored.
Any ideas on how to configure the agent to sync the logs when there are empty lines at the start of the log file?