Class MetricFilter
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<MetricFilter.Builder,MetricFilter>
Metric filters express how CloudWatch Logs would extract metric observations from ingested log events and transform them into metric data in a CloudWatch metric.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanThis parameter is valid only for log groups that have an active log transformer.static MetricFilter.Builderbuilder()final LongThe creation time of the metric filter, expressed as the number of milliseconds afterJan 1, 1970 00:00:00 UTC.The list of system fields that are emitted as additional dimensions in the generated metrics.final booleanfinal booleanequalsBySdkFields(Object obj) final StringThe filter expression that specifies which log events are processed by this metric filter based on system fields.final StringThe name of the metric filter.final StringReturns the value of the FilterPattern property for this object.final <T> Optional<T>getValueForField(String fieldName, Class<T> clazz) final booleanFor responses, this returns true if the service returned a value for the EmitSystemFieldDimensions property.final inthashCode()final booleanFor responses, this returns true if the service returned a value for the MetricTransformations property.final StringThe name of the log group.final List<MetricTransformation>The metric transformations.static Class<? extends MetricFilter.Builder>final StringtoString()Returns a string representation of this object.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
filterName
The name of the metric filter.
- Returns:
- The name of the metric filter.
-
filterPattern
Returns the value of the FilterPattern property for this object.- Returns:
- The value of the FilterPattern property for this object.
-
hasMetricTransformations
public final boolean hasMetricTransformations()For responses, this returns true if the service returned a value for the MetricTransformations property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
metricTransformations
The metric transformations.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasMetricTransformations()method.- Returns:
- The metric transformations.
-
creationTime
The creation time of the metric filter, expressed as the number of milliseconds after
Jan 1, 1970 00:00:00 UTC.- Returns:
- The creation time of the metric filter, expressed as the number of milliseconds after
Jan 1, 1970 00:00:00 UTC.
-
logGroupName
The name of the log group.
- Returns:
- The name of the log group.
-
applyOnTransformedLogs
This parameter is valid only for log groups that have an active log transformer. For more information about log transformers, see PutTransformer.
If this value is
true, the metric filter is applied on the transformed version of the log events instead of the original ingested log events.- Returns:
- This parameter is valid only for log groups that have an active log transformer. For more information
about log transformers, see PutTransformer.
If this value is
true, the metric filter is applied on the transformed version of the log events instead of the original ingested log events.
-
fieldSelectionCriteria
The filter expression that specifies which log events are processed by this metric filter based on system fields. Returns the
fieldSelectionCriteriavalue if it was specified when the metric filter was created.- Returns:
- The filter expression that specifies which log events are processed by this metric filter based on system
fields. Returns the
fieldSelectionCriteriavalue if it was specified when the metric filter was created.
-
hasEmitSystemFieldDimensions
public final boolean hasEmitSystemFieldDimensions()For responses, this returns true if the service returned a value for the EmitSystemFieldDimensions property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
emitSystemFieldDimensions
The list of system fields that are emitted as additional dimensions in the generated metrics. Returns the
emitSystemFieldDimensionsvalue if it was specified when the metric filter was created.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasEmitSystemFieldDimensions()method.- Returns:
- The list of system fields that are emitted as additional dimensions in the generated metrics. Returns the
emitSystemFieldDimensionsvalue if it was specified when the metric filter was created.
-
toBuilder
- Specified by:
toBuilderin interfaceToCopyableBuilder<MetricFilter.Builder,MetricFilter>
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. -
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-