Class ParserProcessor

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.logs.ParserProcessor
All Implemented Interfaces:
IProcessor, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-07-24T11:33:17.326Z") @Stability(Stable) public class ParserProcessor extends software.amazon.jsii.JsiiObject implements IProcessor
Parser processor for common data formats.

Example:

 // Create a log group
 LogGroup logGroup = new LogGroup(this, "MyLogGroup");
 // Create a JSON parser processor
 ParserProcessor jsonParser = ParserProcessor.Builder.create()
         .type(ParserProcessorType.JSON)
         .build();
 // Create a processor to add keys
 JsonMutatorProcessor addKeysProcessor = JsonMutatorProcessor.Builder.create()
         .type(JsonMutatorType.ADD_KEYS)
         .addKeysOptions(AddKeysProperty.builder()
                 .entries(List.of(AddKeyEntryProperty.builder()
                         .key("metadata.transformed_in")
                         .value("CloudWatchLogs")
                         .build()))
                 .build())
         .build();
 // Create a transformer with these processors
 // Create a transformer with these processors
 Transformer.Builder.create(this, "Transformer")
         .transformerName("MyTransformer")
         .logGroup(logGroup)
         .transformerConfig(List.of(jsonParser, addKeysProcessor))
         .build();
 
  • Constructor Details

    • ParserProcessor

      protected ParserProcessor(software.amazon.jsii.JsiiObjectRef objRef)
    • ParserProcessor

      protected ParserProcessor(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ParserProcessor

      @Stability(Stable) public ParserProcessor(@NotNull ParserProcessorProps props)
      Creates a new parser processor.

      Parameters:
      props - This parameter is required.
  • Method Details

    • getType

      @Stability(Stable) @NotNull public ParserProcessorType getType()
      The type of parser.
    • setType

      @Stability(Stable) public void setType(@NotNull ParserProcessorType value)
      The type of parser.