Class Anomaly
- java.lang.Object
-
- software.amazon.awssdk.services.cloudwatchlogs.model.Anomaly
-
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<Anomaly.Builder,Anomaly>
@Generated("software.amazon.awssdk:codegen") public final class Anomaly extends Object implements SdkPojo, Serializable, 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Anomaly.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
active()
Specifies whether this anomaly is still ongoing.String
anomalyDetectorArn()
The ARN of the anomaly detector that identified this anomaly.String
anomalyId()
The unique ID that CloudWatch Logs assigned to this anomaly.static Anomaly.Builder
builder()
String
description()
A human-readable description of the anomaly.boolean
equals(Object obj)
boolean
equalsBySdkFields(Object obj)
Long
firstSeen()
The date and time when the anomaly detector first saw this anomaly.<T> Optional<T>
getValueForField(String fieldName, Class<T> clazz)
int
hashCode()
boolean
hasHistogram()
For responses, this returns true if the service returned a value for the Histogram property.boolean
hasLogGroupArnList()
For responses, this returns true if the service returned a value for the LogGroupArnList property.boolean
hasLogSamples()
For responses, this returns true if the service returned a value for the LogSamples property.boolean
hasPatternTokens()
For responses, this returns true if the service returned a value for the PatternTokens property.Map<String,Long>
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.Boolean
isPatternLevelSuppression()
If this anomaly is suppressed, this field istrue
if the suppression is because the pattern is suppressed.Long
lastSeen()
The date and time when the anomaly detector most recently saw this anomaly.List<String>
logGroupArnList()
An array of ARNS of the log groups that contained log events considered to be part of this anomaly.List<LogEvent>
logSamples()
An array of sample log event messages that are considered to be part of this anomaly.String
patternId()
The ID of the pattern used to help identify this anomaly.String
patternRegex()
The pattern used to help identify this anomaly, in regular expression format.String
patternString()
The pattern used to help identify this anomaly, in string format.List<PatternToken>
patternTokens()
An array of structures where each structure contains information about one token that makes up the pattern.String
priority()
The priority level of this anomaly, as determined by CloudWatch Logs.Map<String,SdkField<?>>
sdkFieldNameToField()
List<SdkField<?>>
sdkFields()
static Class<? extends Anomaly.Builder>
serializableBuilderClass()
State
state()
Indicates the current state of this anomaly.String
stateAsString()
Indicates the current state of this anomaly.Boolean
suppressed()
Indicates whether this anomaly is currently suppressed.Long
suppressedDate()
If the anomaly is suppressed, this indicates when it was suppressed.Long
suppressedUntil()
If the anomaly is suppressed, this indicates when the suppression will end.Anomaly.Builder
toBuilder()
String
toString()
Returns a string representation of this object.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
anomalyId
public final String anomalyId()
The unique ID that CloudWatch Logs assigned to this anomaly.
- Returns:
- The unique ID that CloudWatch Logs assigned to this anomaly.
-
patternId
public final String 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
public final String anomalyDetectorArn()
The ARN of the anomaly detector that identified this anomaly.
- Returns:
- The ARN of the anomaly detector that identified this anomaly.
-
patternString
public final String 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
public final String 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
public final String 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
public final Long 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
public final Long 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
public final String 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
public final Boolean active()
Specifies whether this anomaly is still ongoing.
- Returns:
- Specifies whether this anomaly is still ongoing.
-
state
public final State 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:
State
-
stateAsString
public final String 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:
State
-
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
public final Map<String,Long> 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
public final List<LogEvent> 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
public final List<PatternToken> 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
public final List<String> 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
public final Boolean 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
public final Long 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
public final Long 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
public final Boolean 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
public Anomaly.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<Anomaly.Builder,Anomaly>
-
builder
public static Anomaly.Builder builder()
-
serializableBuilderClass
public static Class<? extends Anomaly.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFields
in interfaceSdkPojo
-
toString
public final String 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.
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToField
in interfaceSdkPojo
-
-