# JsonMutatorType

Types of JSON mutation operations.

Defines operations that can be performed to modify the JSON structure of log events.

- Source: [`aws-logs/lib/transformer.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-logs/lib/transformer.ts#L191)
- Type last changed: v2.207.0 · 24 Jul 2025

## Example

```ts

// Create a log group
const logGroup = new logs.LogGroup(this, 'MyLogGroup');

// Create a JSON parser processor
const jsonParser = new logs.ParserProcessor({
  type: logs.ParserProcessorType.JSON
});

// Create a processor to add keys
const addKeysProcessor = new logs.JsonMutatorProcessor({
  type: logs.JsonMutatorType.ADD_KEYS,
  addKeysOptions: {
    entries: [{
      key: 'metadata.transformed_in',
      value: 'CloudWatchLogs'
    }]
  }
});

// Create a transformer with these processors
new logs.Transformer(this, 'Transformer', {
  transformerName: 'MyTransformer',
  logGroup: logGroup,
  transformerConfig: [jsonParser, addKeysProcessor]
});
```

## Members

| Member | Description |
| --- | --- |
| `ADD_KEYS` | Add new keys to the log event. |
| `DELETE_KEYS` | Delete keys from the log event. |
| `MOVE_KEYS` | Move keys to different locations. |
| `RENAME_KEYS` | Rename keys in the log event. |
| `COPY_VALUE` | Copy values between keys. |
| `LIST_TO_MAP` | Convert a list to a map. |

## Referenced by

- [`JsonMutatorProcessor`](/v2/docs/aws-cdk-lib.aws_logs.JsonMutatorProcessor).type
- [`JsonMutatorProps`](/v2/docs/aws-cdk-lib.aws_logs.JsonMutatorProps).type
