0

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?

Krule
  • 6,468
  • 3
  • 34
  • 56

1 Answers1

0

I have managed to mitigate the problem. In case this might be of interest there is an issue open on Github now.

https://github.com/aws/amazon-ssm-agent/issues/251

Krule
  • 6,468
  • 3
  • 34
  • 56