interface ParserProcessorProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Logs.ParserProcessorProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslogs#ParserProcessorProps |
![]() | software.amazon.awscdk.services.logs.ParserProcessorProps |
![]() | aws_cdk.aws_logs.ParserProcessorProps |
![]() | aws-cdk-lib » aws_logs » ParserProcessorProps |
Properties for creating configurable parser processors.
Example
// 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
Name | Type | Description |
---|---|---|
type | Parser | The type of parser processor. |
csv | Csv | Options for CSV parser. |
grok | Grok | Options for Grok parser. |
json | Parse | Options for JSON parser. |
key | Parse | Options for key-value parser. |
parse | Parse | Options for ParseToOCSF parser. |
type
Type:
Parser
The type of parser processor.
csvOptions?
Type:
Csv
(optional, default: No CSV parser is created if props not set)
Options for CSV parser.
Required when type is CSV.
grokOptions?
Type:
Grok
(optional, default: No Grok parser is created if props not set)
Options for Grok parser.
Required when type is GROK.
jsonOptions?
Type:
Parse
(optional, default: No JSON parser is created if props not set)
Options for JSON parser.
Required when type is JSON.
keyValueOptions?
Type:
Parse
(optional, default: No key-value parser is created if props not set)
Options for key-value parser.
Required when type is KEY_VALUE.
parseToOCSFOptions?
Type:
Parse
(optional, default: no OCSF parser is created.)
Options for ParseToOCSF parser.
Required when type is set to OCSF