/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace CloudWatchLogs { namespace Model { /** *

Indicates how to transform ingested log events to metric data in a CloudWatch * metric.

See Also:

AWS * API Reference

*/ class MetricTransformation { public: AWS_CLOUDWATCHLOGS_API MetricTransformation(); AWS_CLOUDWATCHLOGS_API MetricTransformation(Aws::Utils::Json::JsonView jsonValue); AWS_CLOUDWATCHLOGS_API MetricTransformation& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_CLOUDWATCHLOGS_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The name of the CloudWatch metric.

*/ inline const Aws::String& GetMetricName() const{ return m_metricName; } /** *

The name of the CloudWatch metric.

*/ inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; } /** *

The name of the CloudWatch metric.

*/ inline void SetMetricName(const Aws::String& value) { m_metricNameHasBeenSet = true; m_metricName = value; } /** *

The name of the CloudWatch metric.

*/ inline void SetMetricName(Aws::String&& value) { m_metricNameHasBeenSet = true; m_metricName = std::move(value); } /** *

The name of the CloudWatch metric.

*/ inline void SetMetricName(const char* value) { m_metricNameHasBeenSet = true; m_metricName.assign(value); } /** *

The name of the CloudWatch metric.

*/ inline MetricTransformation& WithMetricName(const Aws::String& value) { SetMetricName(value); return *this;} /** *

The name of the CloudWatch metric.

*/ inline MetricTransformation& WithMetricName(Aws::String&& value) { SetMetricName(std::move(value)); return *this;} /** *

The name of the CloudWatch metric.

*/ inline MetricTransformation& WithMetricName(const char* value) { SetMetricName(value); return *this;} /** *

A custom namespace to contain your metric in CloudWatch. Use namespaces to * group together metrics that are similar. For more information, see Namespaces.

*/ inline const Aws::String& GetMetricNamespace() const{ return m_metricNamespace; } /** *

A custom namespace to contain your metric in CloudWatch. Use namespaces to * group together metrics that are similar. For more information, see Namespaces.

*/ inline bool MetricNamespaceHasBeenSet() const { return m_metricNamespaceHasBeenSet; } /** *

A custom namespace to contain your metric in CloudWatch. Use namespaces to * group together metrics that are similar. For more information, see Namespaces.

*/ inline void SetMetricNamespace(const Aws::String& value) { m_metricNamespaceHasBeenSet = true; m_metricNamespace = value; } /** *

A custom namespace to contain your metric in CloudWatch. Use namespaces to * group together metrics that are similar. For more information, see Namespaces.

*/ inline void SetMetricNamespace(Aws::String&& value) { m_metricNamespaceHasBeenSet = true; m_metricNamespace = std::move(value); } /** *

A custom namespace to contain your metric in CloudWatch. Use namespaces to * group together metrics that are similar. For more information, see Namespaces.

*/ inline void SetMetricNamespace(const char* value) { m_metricNamespaceHasBeenSet = true; m_metricNamespace.assign(value); } /** *

A custom namespace to contain your metric in CloudWatch. Use namespaces to * group together metrics that are similar. For more information, see Namespaces.

*/ inline MetricTransformation& WithMetricNamespace(const Aws::String& value) { SetMetricNamespace(value); return *this;} /** *

A custom namespace to contain your metric in CloudWatch. Use namespaces to * group together metrics that are similar. For more information, see Namespaces.

*/ inline MetricTransformation& WithMetricNamespace(Aws::String&& value) { SetMetricNamespace(std::move(value)); return *this;} /** *

A custom namespace to contain your metric in CloudWatch. Use namespaces to * group together metrics that are similar. For more information, see Namespaces.

*/ inline MetricTransformation& WithMetricNamespace(const char* value) { SetMetricNamespace(value); return *this;} /** *

The value to publish to the CloudWatch metric when a filter pattern matches a * log event.

*/ inline const Aws::String& GetMetricValue() const{ return m_metricValue; } /** *

The value to publish to the CloudWatch metric when a filter pattern matches a * log event.

*/ inline bool MetricValueHasBeenSet() const { return m_metricValueHasBeenSet; } /** *

The value to publish to the CloudWatch metric when a filter pattern matches a * log event.

*/ inline void SetMetricValue(const Aws::String& value) { m_metricValueHasBeenSet = true; m_metricValue = value; } /** *

The value to publish to the CloudWatch metric when a filter pattern matches a * log event.

*/ inline void SetMetricValue(Aws::String&& value) { m_metricValueHasBeenSet = true; m_metricValue = std::move(value); } /** *

The value to publish to the CloudWatch metric when a filter pattern matches a * log event.

*/ inline void SetMetricValue(const char* value) { m_metricValueHasBeenSet = true; m_metricValue.assign(value); } /** *

The value to publish to the CloudWatch metric when a filter pattern matches a * log event.

*/ inline MetricTransformation& WithMetricValue(const Aws::String& value) { SetMetricValue(value); return *this;} /** *

The value to publish to the CloudWatch metric when a filter pattern matches a * log event.

*/ inline MetricTransformation& WithMetricValue(Aws::String&& value) { SetMetricValue(std::move(value)); return *this;} /** *

The value to publish to the CloudWatch metric when a filter pattern matches a * log event.

*/ inline MetricTransformation& WithMetricValue(const char* value) { SetMetricValue(value); return *this;} /** *

(Optional) The value to emit when a filter pattern does not match a log * event. This value can be null.

*/ inline double GetDefaultValue() const{ return m_defaultValue; } /** *

(Optional) The value to emit when a filter pattern does not match a log * event. This value can be null.

*/ inline bool DefaultValueHasBeenSet() const { return m_defaultValueHasBeenSet; } /** *

(Optional) The value to emit when a filter pattern does not match a log * event. This value can be null.

*/ inline void SetDefaultValue(double value) { m_defaultValueHasBeenSet = true; m_defaultValue = value; } /** *

(Optional) The value to emit when a filter pattern does not match a log * event. This value can be null.

*/ inline MetricTransformation& WithDefaultValue(double value) { SetDefaultValue(value); return *this;} /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline const Aws::Map& GetDimensions() const{ return m_dimensions; } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline bool DimensionsHasBeenSet() const { return m_dimensionsHasBeenSet; } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline void SetDimensions(const Aws::Map& value) { m_dimensionsHasBeenSet = true; m_dimensions = value; } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline void SetDimensions(Aws::Map&& value) { m_dimensionsHasBeenSet = true; m_dimensions = std::move(value); } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline MetricTransformation& WithDimensions(const Aws::Map& value) { SetDimensions(value); return *this;} /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline MetricTransformation& WithDimensions(Aws::Map&& value) { SetDimensions(std::move(value)); return *this;} /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline MetricTransformation& AddDimensions(const Aws::String& key, const Aws::String& value) { m_dimensionsHasBeenSet = true; m_dimensions.emplace(key, value); return *this; } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline MetricTransformation& AddDimensions(Aws::String&& key, const Aws::String& value) { m_dimensionsHasBeenSet = true; m_dimensions.emplace(std::move(key), value); return *this; } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline MetricTransformation& AddDimensions(const Aws::String& key, Aws::String&& value) { m_dimensionsHasBeenSet = true; m_dimensions.emplace(key, std::move(value)); return *this; } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline MetricTransformation& AddDimensions(Aws::String&& key, Aws::String&& value) { m_dimensionsHasBeenSet = true; m_dimensions.emplace(std::move(key), std::move(value)); return *this; } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline MetricTransformation& AddDimensions(const char* key, Aws::String&& value) { m_dimensionsHasBeenSet = true; m_dimensions.emplace(key, std::move(value)); return *this; } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline MetricTransformation& AddDimensions(Aws::String&& key, const char* value) { m_dimensionsHasBeenSet = true; m_dimensions.emplace(std::move(key), value); return *this; } /** *

The fields to use as dimensions for the metric. One metric filter can include * as many as three dimensions.

Metrics extracted from log * events are charged as custom metrics. To prevent unexpected high charges, do not * specify high-cardinality fields such as IPAddress or * requestID as dimensions. Each different value found for a dimension * is treated as a separate metric and accrues charges as a separate custom metric. *

CloudWatch Logs disables a metric filter if it generates 1000 different * name/value pairs for your specified dimensions within a certain amount of time. * This helps to prevent accidental high charges.

You can also set up a * billing alarm to alert you if your charges are higher than expected. For more * information, see * Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services * Charges.

*/ inline MetricTransformation& AddDimensions(const char* key, const char* value) { m_dimensionsHasBeenSet = true; m_dimensions.emplace(key, value); return *this; } /** *

The unit to assign to the metric. If you omit this, the unit is set as * None.

*/ inline const StandardUnit& GetUnit() const{ return m_unit; } /** *

The unit to assign to the metric. If you omit this, the unit is set as * None.

*/ inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; } /** *

The unit to assign to the metric. If you omit this, the unit is set as * None.

*/ inline void SetUnit(const StandardUnit& value) { m_unitHasBeenSet = true; m_unit = value; } /** *

The unit to assign to the metric. If you omit this, the unit is set as * None.

*/ inline void SetUnit(StandardUnit&& value) { m_unitHasBeenSet = true; m_unit = std::move(value); } /** *

The unit to assign to the metric. If you omit this, the unit is set as * None.

*/ inline MetricTransformation& WithUnit(const StandardUnit& value) { SetUnit(value); return *this;} /** *

The unit to assign to the metric. If you omit this, the unit is set as * None.

*/ inline MetricTransformation& WithUnit(StandardUnit&& value) { SetUnit(std::move(value)); return *this;} private: Aws::String m_metricName; bool m_metricNameHasBeenSet = false; Aws::String m_metricNamespace; bool m_metricNamespaceHasBeenSet = false; Aws::String m_metricValue; bool m_metricValueHasBeenSet = false; double m_defaultValue; bool m_defaultValueHasBeenSet = false; Aws::Map m_dimensions; bool m_dimensionsHasBeenSet = false; StandardUnit m_unit; bool m_unitHasBeenSet = false; }; } // namespace Model } // namespace CloudWatchLogs } // namespace Aws