We have a setup on AWS where our Windows based VM Instance are part of a autoscaling group. I want to configure Cloud Watch to collect some custom logs from our application's install path on Virtual Machine Instance. But I am not able to find any documentation for that. Can you please point me to right direction
Asked
Active
Viewed 42 times
0
-
Does your application create some log files? Also what version of Windows do you have? – Mahdi Jul 30 '18 at 12:17
-
Yes application is creating its on logs and I am using Windows server 2012 R2 – BlindSniper Sep 19 '18 at 06:44
1 Answers
1
First you need to download the sample configuration files from here and edit it. In the first line of the JSON document set "IsEnabled" to true. Then find the section for "CustomLogs" and edit its "LogDirectoryPath" so that it refers to the folder in which your log files are added (I assume you create daily log files and put them in a folder). You also need to go the "CloudWatchLogs" section and edit "Region" and "LogGroup" (I would name my LogGroup ASG-{AppName}). Finally, find the "Flows" section and edit it like this:
"Flows": {
"Flows":
[
"CustomLogs,CloudWatchLogs"
]}
Note that the "AccessKey" and "SecretKey" should be left blank. You need to handle credentials using an IAM
role.
Now copy this file to the following path:
C:\Program Files\Amazon\SSM\Plugins\awsCloudWatch\
and start or restart the SSM agent (AmazonSSMAgent.exe).

Mahdi
- 3,199
- 2
- 25
- 35