Interface AddKeysProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AddKeysProperty.Jsii$Proxy
@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)",
date="2025-11-04T09:27:44.838Z")
@Stability(Stable)
public interface AddKeysProperty
extends software.amazon.jsii.JsiiSerializable
This processor adds new key-value pairs to the log event.
For more information about this processor including examples, see addKeys in the CloudWatch Logs User Guide.
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();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forAddKeysPropertystatic final classAn implementation forAddKeysProperty -
Method Summary
Modifier and TypeMethodDescriptionstatic AddKeysProperty.Builderbuilder()An array of objects, where each object contains information about one key to add to the log event.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getEntries
An array of objects, where each object contains information about one key to add to the log event. -
builder
- Returns:
- a
AddKeysProperty.BuilderofAddKeysProperty
-