AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the PutLogAlarm operation. Creates or updates a log alarm. A log alarm evaluates the results of a CloudWatch Logs scheduled query against the configured threshold and comparison operator to determine its state.
When you create a log alarm, the operation creates a service-managed CloudWatch Logs
scheduled query that runs the query string you provide on the schedule you configure.
Each scheduled query execution returns one or more aggregated values determined by
the AggregationExpression, and each aggregated value is compared against the
alarm Threshold to determine the alarm state. The alarm uses M-out-of-N evaluation:
if QueryResultsToAlarm out of the most recent QueryResultsToEvaluate
query results breach the threshold, the alarm transitions to ALARM.
Log alarms support the alarm states (OK, ALARM, INSUFFICIENT_DATA).
Configure transition actions using OKActions, AlarmActions, and InsufficientDataActions.
If you call this operation with the name of an existing log alarm, the operation replaces the previous configuration of that alarm.
Permissions
To create or update a log alarm, you must have the cloudwatch:PutLogAlarm permission.
The IAM role specified in ScheduledQueryRoleARN must grant the CloudWatch Alarms
service permission to execute scheduled queries on the specified log groups. If you
set ActionLogLineCount, the role specified in ActionLogLineRoleArn must
grant permission to retrieve log events for inclusion in alarm notifications.
Namespace: Amazon.CloudWatch.Model
Assembly: AWSSDK.CloudWatch.dll
Version: 3.x.y.z
public class PutLogAlarmRequest : AmazonCloudWatchRequest IAmazonWebServiceRequest
The PutLogAlarmRequest type exposes the following members
| Name | Description | |
|---|---|---|
|
PutLogAlarmRequest() |
| Name | Type | Description | |
|---|---|---|---|
|
ActionLogLineCount | System.Nullable<System.Int32> |
Gets and sets the property ActionLogLineCount. The number of log lines from the most recent scheduled query execution to include in alarm action notifications. Valid range is 0 through 50. The default is 0, which means no log lines are included. |
|
ActionLogLineRoleArn | System.String |
Gets and sets the property ActionLogLineRoleArn.
The Amazon Resource Name (ARN) of an IAM role that CloudWatch assumes to retrieve
log events for inclusion in alarm action notifications. Required when |
|
ActionsEnabled | System.Nullable<System.Boolean> |
Gets and sets the property ActionsEnabled.
Indicates whether actions should be executed during any changes to the alarm state.
The default is |
|
AlarmActions | System.Collections.Generic.List<System.String> |
Gets and sets the property AlarmActions.
The actions to execute when this alarm transitions to the Valid Values: Amazon SNS actions:
Lambda actions:
Systems Manager actions:
|
|
AlarmDescription | System.String |
Gets and sets the property AlarmDescription. The description for the alarm. |
|
AlarmName | System.String |
Gets and sets the property AlarmName. The name for the alarm. This name must be unique within the Amazon Web Services account and Region. |
|
ComparisonOperator | Amazon.CloudWatch.ComparisonOperator |
Gets and sets the property ComparisonOperator.
The arithmetic operation to use when comparing the aggregated query result and the
threshold. The aggregated query result is used as the first operand. Valid values
are |
|
InsufficientDataActions | System.Collections.Generic.List<System.String> |
Gets and sets the property InsufficientDataActions.
The actions to execute when this alarm transitions to the Valid Values: Amazon SNS actions:
Lambda actions:
|
|
OKActions | System.Collections.Generic.List<System.String> |
Gets and sets the property OKActions.
The actions to execute when this alarm transitions to the Valid Values: Amazon SNS actions:
Lambda actions:
|
|
QueryResultsToAlarm | System.Nullable<System.Int32> |
Gets and sets the property QueryResultsToAlarm.
The number of query results, out of the most recent |
|
QueryResultsToEvaluate | System.Nullable<System.Int32> |
Gets and sets the property QueryResultsToEvaluate. The number of most recent scheduled query results to evaluate against the threshold (the N in M-of-N evaluation). Valid range is 1 through 100. |
|
ScheduledQueryConfiguration | Amazon.CloudWatch.Model.ScheduledQueryConfiguration |
Gets and sets the property ScheduledQueryConfiguration. The configuration of the underlying CloudWatch Logs scheduled query that this alarm evaluates, including the query string, log groups, schedule, and aggregation expression. |
|
Tags | System.Collections.Generic.List<Amazon.CloudWatch.Model.Tag> |
Gets and sets the property Tags. A list of key-value pairs to associate with the alarm. You can use tags to categorize and manage your alarms. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true. |
|
Threshold | System.Nullable<System.Double> |
Gets and sets the property Threshold. The value to compare with the aggregated query result. |
|
TreatMissingData | System.String |
Gets and sets the property TreatMissingData.
Sets how this alarm is to handle missing data points. Valid values are |
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.7.2 and newer