Class Anomaly
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<Anomaly.Builder,
Anomaly>
This structure represents one anomaly that has been found by a logs anomaly detector.
For more information about patterns and anomalies, see CreateLogAnomalyDetector.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Boolean
active()
Specifies whether this anomaly is still ongoing.final String
The ARN of the anomaly detector that identified this anomaly.final String
The unique ID that CloudWatch Logs assigned to this anomaly.static Anomaly.Builder
builder()
final String
A human-readable description of the anomaly.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final Long
The date and time when the anomaly detector first saw this anomaly.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final int
hashCode()
final boolean
For responses, this returns true if the service returned a value for the Histogram property.final boolean
For responses, this returns true if the service returned a value for the LogGroupArnList property.final boolean
For responses, this returns true if the service returned a value for the LogSamples property.final boolean
For responses, this returns true if the service returned a value for the PatternTokens property.A map showing times when the anomaly detector ran, and the number of occurrences of this anomaly that were detected at each of those runs.final Boolean
If this anomaly is suppressed, this field istrue
if the suppression is because the pattern is suppressed.final Long
lastSeen()
The date and time when the anomaly detector most recently saw this anomaly.An array of ARNS of the log groups that contained log events considered to be part of this anomaly.An array of sample log event messages that are considered to be part of this anomaly.final String
The ID of the pattern used to help identify this anomaly.final String
The pattern used to help identify this anomaly, in regular expression format.final String
The pattern used to help identify this anomaly, in string format.final List
<PatternToken> An array of structures where each structure contains information about one token that makes up the pattern.final String
priority()
The priority level of this anomaly, as determined by CloudWatch Logs.static Class
<? extends Anomaly.Builder> final State
state()
Indicates the current state of this anomaly.final String
Indicates the current state of this anomaly.final Boolean
Indicates whether this anomaly is currently suppressed.final Long
If the anomaly is suppressed, this indicates when it was suppressed.final Long
If the anomaly is suppressed, this indicates when the suppression will end.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
anomalyId
The unique ID that CloudWatch Logs assigned to this anomaly.
- Returns:
- The unique ID that CloudWatch Logs assigned to this anomaly.
-
patternId
The ID of the pattern used to help identify this anomaly.
- Returns:
- The ID of the pattern used to help identify this anomaly.
-
anomalyDetectorArn
The ARN of the anomaly detector that identified this anomaly.
- Returns:
- The ARN of the anomaly detector that identified this anomaly.
-
patternString
The pattern used to help identify this anomaly, in string format.
- Returns:
- The pattern used to help identify this anomaly, in string format.
-
patternRegex
The pattern used to help identify this anomaly, in regular expression format.
- Returns:
- The pattern used to help identify this anomaly, in regular expression format.
-
priority
The priority level of this anomaly, as determined by CloudWatch Logs. Priority is computed based on log severity labels such as
FATAL
andERROR
and the amount of deviation from the baseline. Possible values areHIGH
,MEDIUM
, andLOW
.- Returns:
- The priority level of this anomaly, as determined by CloudWatch Logs. Priority is computed based on log
severity labels such as
FATAL
andERROR
and the amount of deviation from the baseline. Possible values areHIGH
,MEDIUM
, andLOW
.
-
firstSeen
The date and time when the anomaly detector first saw this anomaly. It is specified as epoch time, which is the number of seconds since
January 1, 1970, 00:00:00 UTC
.- Returns:
- The date and time when the anomaly detector first saw this anomaly. It is specified as epoch time, which
is the number of seconds since
January 1, 1970, 00:00:00 UTC
.
-
lastSeen
The date and time when the anomaly detector most recently saw this anomaly. It is specified as epoch time, which is the number of seconds since
January 1, 1970, 00:00:00 UTC
.- Returns:
- The date and time when the anomaly detector most recently saw this anomaly. It is specified as epoch
time, which is the number of seconds since
January 1, 1970, 00:00:00 UTC
.
-
description
A human-readable description of the anomaly. This description is generated by CloudWatch Logs.
- Returns:
- A human-readable description of the anomaly. This description is generated by CloudWatch Logs.
-
active
Specifies whether this anomaly is still ongoing.
- Returns:
- Specifies whether this anomaly is still ongoing.
-
state
Indicates the current state of this anomaly. If it is still being treated as an anomaly, the value is
Active
. If you have suppressed this anomaly by using the UpdateAnomaly operation, the value isSuppressed
. If this behavior is now considered to be normal, the value isBaseline
.If the service returns an enum value that is not available in the current SDK version,
state
will returnState.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstateAsString()
.- Returns:
- Indicates the current state of this anomaly. If it is still being treated as an anomaly, the value is
Active
. If you have suppressed this anomaly by using the UpdateAnomaly operation, the value isSuppressed
. If this behavior is now considered to be normal, the value isBaseline
. - See Also:
-
stateAsString
Indicates the current state of this anomaly. If it is still being treated as an anomaly, the value is
Active
. If you have suppressed this anomaly by using the UpdateAnomaly operation, the value isSuppressed
. If this behavior is now considered to be normal, the value isBaseline
.If the service returns an enum value that is not available in the current SDK version,
state
will returnState.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstateAsString()
.- Returns:
- Indicates the current state of this anomaly. If it is still being treated as an anomaly, the value is
Active
. If you have suppressed this anomaly by using the UpdateAnomaly operation, the value isSuppressed
. If this behavior is now considered to be normal, the value isBaseline
. - See Also:
-
hasHistogram
public final boolean hasHistogram()For responses, this returns true if the service returned a value for the Histogram 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. -
histogram
A map showing times when the anomaly detector ran, and the number of occurrences of this anomaly that were detected at each of those runs. The times are specified in epoch time, which is the number of seconds since
January 1, 1970, 00:00:00 UTC
.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
hasHistogram()
method.- Returns:
- A map showing times when the anomaly detector ran, and the number of occurrences of this anomaly that
were detected at each of those runs. The times are specified in epoch time, which is the number of
seconds since
January 1, 1970, 00:00:00 UTC
.
-
hasLogSamples
public final boolean hasLogSamples()For responses, this returns true if the service returned a value for the LogSamples 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. -
logSamples
An array of sample log event messages that are considered to be part of this anomaly.
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
hasLogSamples()
method.- Returns:
- An array of sample log event messages that are considered to be part of this anomaly.
-
hasPatternTokens
public final boolean hasPatternTokens()For responses, this returns true if the service returned a value for the PatternTokens 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. -
patternTokens
An array of structures where each structure contains information about one token that makes up the pattern.
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
hasPatternTokens()
method.- Returns:
- An array of structures where each structure contains information about one token that makes up the pattern.
-
hasLogGroupArnList
public final boolean hasLogGroupArnList()For responses, this returns true if the service returned a value for the LogGroupArnList 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. -
logGroupArnList
An array of ARNS of the log groups that contained log events considered to be part of this anomaly.
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
hasLogGroupArnList()
method.- Returns:
- An array of ARNS of the log groups that contained log events considered to be part of this anomaly.
-
suppressed
Indicates whether this anomaly is currently suppressed. To suppress an anomaly, use UpdateAnomaly.
- Returns:
- Indicates whether this anomaly is currently suppressed. To suppress an anomaly, use UpdateAnomaly.
-
suppressedDate
If the anomaly is suppressed, this indicates when it was suppressed.
- Returns:
- If the anomaly is suppressed, this indicates when it was suppressed.
-
suppressedUntil
If the anomaly is suppressed, this indicates when the suppression will end. If this value is
0
, the anomaly was suppressed with no expiration, with theINFINITE
value.- Returns:
- If the anomaly is suppressed, this indicates when the suppression will end. If this value is
0
, the anomaly was suppressed with no expiration, with theINFINITE
value.
-
isPatternLevelSuppression
If this anomaly is suppressed, this field is
true
if the suppression is because the pattern is suppressed. Iffalse
, then only this particular anomaly is suppressed.- Returns:
- If this anomaly is suppressed, this field is
true
if the suppression is because the pattern is suppressed. Iffalse
, then only this particular anomaly is suppressed.
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<Anomaly.Builder,
Anomaly> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
Description copied from interface:SdkPojo
Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
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
-