# JsonMutatorProps

Properties for creating JSON mutator processors.

Extends: JsonMutatorProps
Extends: BaseProcessorProps
Used as props by: JsonMutatorProcessor

- Source: [`aws-logs/lib/transformer.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-logs/lib/transformer.ts#L622)
- 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]
});
```

## Properties

- `addKeysOptions`: [AddKeysProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.AddKeysProperty.html) — Options for adding keys.

  **Default:** No adding keys processor is created if props not set

  Required when type is ADD_KEYS.

- `copyValueOptions`: [CopyValueProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.CopyValueProperty.html) — Options for copying values.

  **Default:** No copy value processor is created if props not set

  Required when type is COPY_VALUE.

- `deleteKeysOptions`: [ProcessorDeleteKeysProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.ProcessorDeleteKeysProperty.html) — Keys to delete.

  **Default:** No delete key processor is created if props not set

  Required when type is DELETE_KEYS.

- `listToMapOptions`: [ListToMapProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.ListToMapProperty.html) — Options for converting lists to maps.

  **Default:** No list-to-map processor is created if props not set

  Required when type is LIST_TO_MAP.

- `moveKeysOptions`: [MoveKeysProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.MoveKeysProperty.html) — Options for moving keys.

  **Default:** No move key processor is created if props not set

  Required when type is MOVE_KEYS.

- `renameKeysOptions`: [RenameKeysProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.RenameKeysProperty.html) — Options for renaming keys.

  **Default:** No rename key processor is created if props not set

  Required when type is RENAME_KEYS.

- `type`: [JsonMutatorType](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.JsonMutatorType.html) (required) — The type of JSON mutation operation.
