Class Anomaly

    • 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 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:
        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 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:
        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 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.
      • 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
      • 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)