AWS CloudWatch Logs
Collect asset and monitoring data for AWS CloudWatch Logs log groups.
Configuration¶
Permissions¶
For AWS cloud collection permissions, see AWS cloud integration role authorization. The read-only permissions required by this integration are listed below.
logs:DescribeLogGroups: Get CloudWatch Logs log group information for asset collection.tag:GetResources: Read resource tags through the shared tag collection module to supplement asset tags.cloudwatch:ListMetrics: Discover CloudWatch monitoring metrics and dimensions.cloudwatch:GetMetricData: Read in batches: CloudWatch monitoring metric data.
Install Func¶
It is recommended to enable Guance integration - extension - DataFlux Func (Automata): all prerequisites are automatically installed, please proceed with the script installation.
If deploying Func manually, refer to Manual Func Deployment
Activate Script¶
Prepare AWS AK in advance and authorize access as described in Permissions.
Activate Scripts in Hosted Func¶
- Log in to the Guance console
- Click the 【Integration】 menu and select 【Cloud Account Management】
- Click 【Add Cloud Account】, select 【AWS】, and fill in the required information on the interface. If you have already configured the cloud account information before, ignore this step
- Click 【Test】, and if the test is successful, click 【Save】. If the test fails, please check if the relevant configuration information is correct and test again
- Click 【Cloud Account Management】, and you can see the added cloud account in the list. Click the corresponding cloud account to enter the details page
- Click 【Integration】 on the cloud account details page, find
AWS CloudWatch Logsin theNot Installedlist and click 【Install】 to open the installation form.
Manual Activation Script¶
- Log in to the Func console, click 【Script Market】, open the Guance script market and search for
integration_aws_logs. - Click 【Install】 and enter AWS AK ID, AK Secret, and the account name.
- Click 【Deploy Startup Script】 to create the
Startupscript set and configure the corresponding startup scripts automatically. - After enabling the script, open 【Management / Automatic Trigger Configuration】 to view its automatic trigger configuration. Click 【Execute】 to run it immediately without waiting for the scheduled time. After a short wait, review the task records and logs.
Verification¶
- In "Manage / Automatic Trigger Configuration", confirm whether the corresponding task has the corresponding automatic trigger configuration, and check the corresponding task records and logs for any exceptions.
- In Guance, check the
aws_logs_log_grouplog group objects under [Infrastructure / Custom]. - In Guance, check if there are corresponding monitoring data in "Metrics".
Metrics¶
Configure AWS cloud monitoring to collect additional metrics AWS cloud monitoring metric details
AWS CloudWatch Logs metrics are in the aws_logs measurement; the description column provides each metric's description, unit, and statistics.
| MetricName | MetricDescribe | Dimensions | Unit |
|---|---|---|---|
incoming_log_events_sum |
The number of log events uploaded to the log group | account_name, region_id, log_group_name | count |
incoming_bytes_sum |
Number of uncompressed log bytes uploaded to the log group | account_name, region_id, log_group_name | B |
call_count_sum |
Number of calls to the specified CloudWatch Logs API operation | account_name, region_id, class, resource, service, type | count |
error_count_sum |
Number of CloudWatch Logs API operations that returned errors | account_name, region_id, class, resource, service, type | count |
throttle_count_sum |
Number of CloudWatch Logs API operations that are restricted due to quota usage | account_name, region_id, class, resource, service, type | count |
forwarded_bytes_sum |
Number of compressed log bytes forwarded to the subscription target | account_name, region_id, destination_type, filter_name, log_group_name | B |
forwarded_log_events_sum |
The number of log events forwarded to the subscription target | account_name, region_id, destination_type, filter_name, log_group_name | count |
delivery_errors_sum |
Number of log events for which errors occurred while forwarding to the subscription target | account_name, region_id, destination_type, filter_name, log_group_name | count |
delivery_throttling_sum |
Number of log events throttled while forwarding to the subscription destination | account_name, region_id, destination_type, filter_name, log_group_name | count |
emfparsing_errors_sum |
Number of parsing errors that occurred when processing embedded metric format logs | account_name, region_id, log_group_name | count |
emfvalidation_errors_sum |
Number of metric definition validation errors in Embedded Metric Format logs | account_name, region_id, log_group_name | count |
emfdisabled_errors_sum |
Number of embedded metric format log events ignored due to metric extraction policy disabled | account_name, region_id, log_group_name | count |
transformed_log_events_sum |
Number of log events that completed conversion | account_name, region_id, log_group_name | count |
transformed_bytes_sum |
Uncompressed output bytes of log events after conversion | account_name, region_id, log_group_name | B |
transformation_errors_sum |
The number of errors that occurred while converting log events | account_name, region_id, log_group_name | count |
log_events_with_findings_sum |
Number of log events that hit data protection audit rules | account_name, region_id, data_protection_operation, log_group_name | count |
Object¶
{
"measurement": "aws_logs_log_group",
"tags": {
"account_name": "<Account name>",
"region_id": "<Region>",
"log_group_name": "<Log group name>",
"log_group_class": "STANDARD"
},
"fields": {
"creation_time": 1794202086312,
"retention_in_days": 1,
"stored_bytes": 0,
"metric_filter_count": 0
}
}
Note: The fields in tags and fields may change with subsequent updates.