# ParserProcessorProps

Properties for creating configurable parser processors.

Extends: ParserProcessorProps
Extends: BaseProcessorProps
Used as props by: ParserProcessor

- 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#L549)
- 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

- `csvOptions`: [CsvProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.CsvProperty.html) — Options for CSV parser.

  **Default:** No CSV parser is created if props not set

  Required when type is CSV.

- `grokOptions`: [GrokProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.GrokProperty.html) — Options for Grok parser.

  **Default:** No Grok parser is created if props not set

  Required when type is GROK.

- `jsonOptions`: [ParseJSONProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.ParseJSONProperty.html) — Options for JSON parser.

  **Default:** No JSON parser is created if props not set

  Required when type is JSON.

- `keyValueOptions`: [ParseKeyValueProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.ParseKeyValueProperty.html) — Options for key-value parser.

  **Default:** No key-value parser is created if props not set

  Required when type is KEY_VALUE.

- `parseToOCSFOptions`: [ParseToOCSFProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.ParseToOCSFProperty.html) — Options for ParseToOCSF parser.

  **Default:** no OCSF parser is created.

  Required when type is set to OCSF

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