# JsonMutatorProcessor

Processor for JSON mutation operations.

Extends: JsonMutatorProcessor
Implements: IProcessor

- 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#L1027)
- 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]
});
```

## Initializer

```ts
new JsonMutatorProcessor(props: JsonMutatorProps)
```

## Properties

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