Skip to content

Instantly share code, notes, and snippets.

@omardulaimi
Last active November 12, 2020 07:27
Show Gist options
  • Save omardulaimi/9993ac82302a2e9ab74b539a8d7f9523 to your computer and use it in GitHub Desktop.
Save omardulaimi/9993ac82302a2e9ab74b539a8d7f9523 to your computer and use it in GitHub Desktop.
{
"agent": {
"metrics_collection_interval": 60,
"run_as_user": "root"
},
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{
"file_path": "/var/log/syslog",
"log_group_name": "EC2-Instances-Logging",
"log_stream_name": "{instance_id}-ServerNameHere-syslog",
"timestamp_format": "%H:%M:%S %y %b %-d"
},
{
"file_path": "/var/log/auth.log",
"log_group_name": "EC2-Instances-Logging",
"log_stream_name": "{instance_id}-ServerNameHere-authlog",
"timestamp_format": "%H:%M:%S %y %b %-d"
},
{
"file_path": "/var/log/dpkg.log",
"log_group_name": "EC2-Instances-Logging",
"log_stream_name": "{instance_id}-ServerNameHere-dpkglog",
"timestamp_format": "%H:%M:%S %y %b %-d"
},
{
"file_path": "/var/log/kern.log",
"log_group_name": "EC2-Instances-Logging",
"log_stream_name": "{instance_id}-ServerNameHere-kernlog",
"timestamp_format": "%H:%M:%S %y %b %-d"
},
{
"file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
"log_group_name": "EC2-Instances-Logging",
"log_stream_name": "{instance_id}-ServerNameHere-ssmagentlog",
"timestamp_format": "%H:%M:%S %y %b %-d"
},
{
"file_path": "/var/log/amazon/ssm/errors.log",
"log_group_name": "EC2-Instances-Logging",
"log_stream_name": "{instance_id}-ServerNameHere-errorslog",
"timestamp_format": "%H:%M:%S %y %b %-d"
}
]
}
}
},
"metrics": {
"append_dimensions": {
"AutoScalingGroupName": "${aws:AutoScalingGroupName}",
"ImageId": "${aws:ImageId}",
"InstanceId": "${aws:InstanceId}",
"InstanceType": "${aws:InstanceType}"
},
"metrics_collected": {
"disk": {
"measurement": [
"used_percent"
],
"metrics_collection_interval": 60,
"resources": [
"*"
]
},
"mem": {
"measurement": [
"mem_used_percent"
],
"metrics_collection_interval": 60
},
"statsd": {
"metrics_aggregation_interval": 60,
"metrics_collection_interval": 10,
"service_address": ":8125"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment