CloudWatch Contributor Insights rule examples - Amazon CloudWatch

CloudWatch Contributor Insights rule examples

This section contains examples that illustrate use cases for Contributor Insights rules.

VPC Flow Logs: Byte transfers by source and destination IP address

{ "Schema": { "Name": "CloudWatchLogRule", "Version": 1 }, "LogGroupNames": [ "/aws/containerinsights/sample-cluster-name/flowlogs" ], "LogFormat": "CLF", "Fields": { "4": "srcaddr", "5": "dstaddr", "10": "bytes" }, "Contribution": { "Keys": [ "srcaddr", "dstaddr" ], "ValueOf": "bytes", "Filters": [] }, "AggregateOn": "Sum" }

VPC Flow Logs: Highest number of HTTPS requests

{ "Schema": { "Name": "CloudWatchLogRule", "Version": 1 }, "LogGroupNames": [ "/aws/containerinsights/sample-cluster-name/flowlogs" ], "LogFormat": "CLF", "Fields": { "5": "destination address", "7": "destination port", "9": "packet count" }, "Contribution": { "Keys": [ "destination address" ], "ValueOf": "packet count", "Filters": [ { "Match": "destination port", "EqualTo": 443 } ] }, "AggregateOn": "Sum" }

VPC Flow Logs: Rejected TCP connections

{ "Schema": { "Name": "CloudWatchLogRule", "Version": 1 }, "LogGroupNames": [ "/aws/containerinsights/sample-cluster-name/flowlogs" ], "LogFormat": "CLF", "Fields": { "3": "interfaceID", "4": "sourceAddress", "8": "protocol", "13": "action" }, "Contribution": { "Keys": [ "interfaceID", "sourceAddress" ], "Filters": [ { "Match": "protocol", "EqualTo": 6 }, { "Match": "action", "In": [ "REJECT" ] } ] }, "AggregateOn": "Sum" }

Route 53 NXDomain responses by source address

{ "Schema": { "Name": "CloudWatchLogRule", "Version": 1 }, "AggregateOn": "Count", "Contribution": { "Filters": [ { "Match": "$.rcode", "StartsWith": [ "NXDOMAIN" ] } ], "Keys": [ "$.srcaddr" ] }, "LogFormat": "JSON", "LogGroupNames": [ "<loggroupname>" ] }

Route 53 resolver queries by domain name

{ "Schema": { "Name": "CloudWatchLogRule", "Version": 1 }, "AggregateOn": "Count", "Contribution": { "Filters": [], "Keys": [ "$.query_name" ] }, "LogFormat": "JSON", "LogGroupNames": [ "<loggroupname>" ] }

Route 53 resolver queries by query type and source address

{ "Schema": { "Name": "CloudWatchLogRule", "Version": 1 }, "AggregateOn": "Count", "Contribution": { "Filters": [], "Keys": [ "$.query_type", "$.srcaddr" ] }, "LogFormat": "JSON", "LogGroupNames": [ "<loggroupname>" ] }