Interface LogGroupTargetInputOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
LogGroupTargetInputOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:07.489Z") @Stability(Stable) public interface LogGroupTargetInputOptions extends software.amazon.jsii.JsiiSerializable
Options used when creating a target input template.

Example:

 import software.amazon.awscdk.services.logs.*;
 LogGroup logGroup;
 Rule rule;
 rule.addTarget(CloudWatchLogGroup.Builder.create(logGroup)
         .logEvent(LogGroupTargetInput.fromObject(LogGroupTargetInputOptions.builder()
                 .timestamp(EventField.fromPath("$.time"))
                 .message(EventField.fromPath("$.detail-type"))
                 .build()))
         .build());
 
  • Method Details

    • getMessage

      @Stability(Stable) @Nullable default Object getMessage()
      The value provided here will be used in the Log "message" field.

      This field must be a string. If an object is passed (e.g. JSON data) it will not throw an error, but the message that makes it to CloudWatch logs will be incorrect. This is a likely scenario if doing something like: EventField.fromPath('$.detail') since in most cases the detail field contains JSON data.

      Default: EventField.detailType

    • getTimestamp

      @Stability(Stable) @Nullable default Object getTimestamp()
      The timestamp that will appear in the CloudWatch Logs record.

      Default: EventField.time

    • builder

      @Stability(Stable) static LogGroupTargetInputOptions.Builder builder()
      Returns:
      a LogGroupTargetInputOptions.Builder of LogGroupTargetInputOptions