first commit

This commit is contained in:
xpk
2019-04-01 14:01:33 +08:00
commit 99a3a44fe3
3 changed files with 179 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
# awslog agent
this role install awslog agent which sends syslog to cloudwatch. the default config sends /var/log/messages to cloudwatch. the default config is shown below.
```
[/var/log/messages]
datetime_format = %Y-%m-%d %H:%M:%S
file = /var/log/messages
buffer_duration = 5000
log_stream_name = {hostname}
initial_position = start_of_file
log_group_name = /var/log/messages
```
## requirements
instances need the following permissions:
- CreateLogStream
- DescribeLogStreams
- CreateLogGroup
- PutLogEvents
## references:
- https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/QuickStartEC2Instance.html