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:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final Boolean
    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.
     
    final String
    A human-readable description of the anomaly.
    final boolean
     
    final boolean
    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
     
    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.
    final Map<String,Long>
    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 is true if the suppression is because the pattern is suppressed.
    final Long
    The date and time when the anomaly detector most recently saw this anomaly.
    final List<String>
    An array of ARNS of the log groups that contained log events considered to be part of this anomaly.
    final List<LogEvent>
    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.
    An array of structures where each structure contains information about one token that makes up the pattern.
    final String
    The priority level of this anomaly, as determined by CloudWatch Logs.
    final List<SdkField<?>>
     
    static Class<? extends Anomaly.Builder>
     
    final 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
    Returns a string representation of this object.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder

    copy
  • Method Details

    • 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 and ERROR and the amount of deviation from the baseline. Possible values are HIGH, MEDIUM, and LOW.

      Returns:
      The priority level of this anomaly, as determined by CloudWatch Logs. Priority is computed based on log severity labels such as FATAL and ERROR and the amount of deviation from the baseline. Possible values are HIGH, MEDIUM, and LOW.
    • 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 is Suppressed. If this behavior is now considered to be normal, the value is Baseline.

      If the service returns an enum value that is not available in the current SDK version, state will return State.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from stateAsString().

      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 is Suppressed. If this behavior is now considered to be normal, the value is Baseline.
      See Also:
    • 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 is Suppressed. If this behavior is now considered to be normal, the value is Baseline.

      If the service returns an enum value that is not available in the current SDK version, state will return State.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from stateAsString().

      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 is Suppressed. If this behavior is now considered to be normal, the value is Baseline.
      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 the isEmpty() 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 the isEmpty() 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 the isEmpty() 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 the isEmpty() 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 the INFINITE 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 the INFINITE value.
    • isPatternLevelSuppression

      public final Boolean isPatternLevelSuppression()

      If this anomaly is suppressed, this field is true if the suppression is because the pattern is suppressed. If false, 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. If false, then only this particular anomaly is suppressed.
    • toBuilder

      public Anomaly.Builder 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 interface ToCopyableBuilder<Anomaly.Builder,Anomaly>
      Returns:
      a builder for type T
    • builder

      public static Anomaly.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Anomaly.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      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 an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • 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.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.