Enum JsonMutatorType
Types of JSON mutation operations.
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum JsonMutatorType
Syntax (vb)
Public Enum JsonMutatorType
Remarks
Defines operations that can be performed to modify the JSON structure of log events.
ExampleMetadata: infused
Examples
// Create a log group
var logGroup = new LogGroup(this, "MyLogGroup");
// Create a JSON parser processor
var jsonParser = new ParserProcessor(new ParserProcessorProps {
Type = ParserProcessorType.JSON
});
// Create a processor to add keys
var addKeysProcessor = new JsonMutatorProcessor(new JsonMutatorProps {
Type = JsonMutatorType.ADD_KEYS,
AddKeysOptions = new AddKeysProperty {
Entries = new [] { new AddKeyEntryProperty {
Key = "metadata.transformed_in",
Value = "CloudWatchLogs"
} }
}
});
// Create a transformer with these processors
// Create a transformer with these processors
new Transformer(this, "Transformer", new TransformerProps {
TransformerName = "MyTransformer",
LogGroup = logGroup,
TransformerConfig = new [] { jsonParser, addKeysProcessor }
});
Synopsis
Fields
ADD_KEYS | Add new keys to the log event. |
COPY_VALUE | Copy values between keys. |
DELETE_KEYS | Delete keys from the log event. |
LIST_TO_MAP | Convert a list to a map. |
MOVE_KEYS | Move keys to different locations. |
RENAME_KEYS | Rename keys in the log event. |
Fields
Name | Description |
---|---|
ADD_KEYS | Add new keys to the log event. |
COPY_VALUE | Copy values between keys. |
DELETE_KEYS | Delete keys from the log event. |
LIST_TO_MAP | Convert a list to a map. |
MOVE_KEYS | Move keys to different locations. |
RENAME_KEYS | Rename keys in the log event. |