# ParserProcessor

Parser processor for common data formats.

Extends: ParserProcessor
Implements: IProcessor

- 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#L816)
- 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 ParserProcessor(props: ParserProcessorProps)
```

## Properties

- `type`: [ParserProcessorType](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.ParserProcessorType.html) — The type of parser.
