Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

TestTransformer

Focus mode
TestTransformer - Amazon CloudWatch Logs

Use this operation to test a log transformer. You enter the transformer configuration and a set of log events to test with. The operation responds with an array that includes the original log events and the transformed versions.

Request Syntax

{ "logEventMessages": [ "string" ], "transformerConfig": [ { "addKeys": { "entries": [ { "key": "string", "overwriteIfExists": boolean, "value": "string" } ] }, "copyValue": { "entries": [ { "overwriteIfExists": boolean, "source": "string", "target": "string" } ] }, "csv": { "columns": [ "string" ], "delimiter": "string", "quoteCharacter": "string", "source": "string" }, "dateTimeConverter": { "locale": "string", "matchPatterns": [ "string" ], "source": "string", "sourceTimezone": "string", "target": "string", "targetFormat": "string", "targetTimezone": "string" }, "deleteKeys": { "withKeys": [ "string" ] }, "grok": { "match": "string", "source": "string" }, "listToMap": { "flatten": boolean, "flattenedElement": "string", "key": "string", "source": "string", "target": "string", "valueKey": "string" }, "lowerCaseString": { "withKeys": [ "string" ] }, "moveKeys": { "entries": [ { "overwriteIfExists": boolean, "source": "string", "target": "string" } ] }, "parseCloudfront": { "source": "string" }, "parseJSON": { "destination": "string", "source": "string" }, "parseKeyValue": { "destination": "string", "fieldDelimiter": "string", "keyPrefix": "string", "keyValueDelimiter": "string", "nonMatchValue": "string", "overwriteIfExists": boolean, "source": "string" }, "parsePostgres": { "source": "string" }, "parseRoute53": { "source": "string" }, "parseVPC": { "source": "string" }, "parseWAF": { "source": "string" }, "renameKeys": { "entries": [ { "key": "string", "overwriteIfExists": boolean, "renameTo": "string" } ] }, "splitString": { "entries": [ { "delimiter": "string", "source": "string" } ] }, "substituteString": { "entries": [ { "from": "string", "source": "string", "to": "string" } ] }, "trimString": { "withKeys": [ "string" ] }, "typeConverter": { "entries": [ { "key": "string", "type": "string" } ] }, "upperCaseString": { "withKeys": [ "string" ] } } ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

logEventMessages

An array of the raw log events that you want to use to test this transformer.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Length Constraints: Minimum length of 1.

Required: Yes

transformerConfig

This structure contains the configuration of this log transformer that you want to test. A log transformer is an array of processors, where each processor applies one type of transformation to the log events that are ingested.

Type: Array of Processor objects

Array Members: Minimum number of 1 item. Maximum number of 20 items.

Required: Yes

Response Syntax

{ "transformedLogs": [ { "eventMessage": "string", "eventNumber": number, "transformedEventMessage": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

transformedLogs

An array where each member of the array includes both the original version and the transformed version of one of the log events that you input.

Type: Array of TransformedLogRecord objects

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidOperationException

The operation is not valid on the specified resource.

HTTP Status Code: 400

InvalidParameterException

A parameter is specified incorrectly.

HTTP Status Code: 400

ServiceUnavailableException

The service cannot complete the request.

HTTP Status Code: 500

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.