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.”

Viewing Text Logs in Amazon CloudWatch Logs

Focus mode
Viewing Text Logs in Amazon CloudWatch Logs - Amazon Lex V1

End of support notice: On September 15, 2025, AWS will discontinue support for Amazon Lex V1. After September 15, 2025, you will no longer be able to access the Amazon Lex V1 console or Amazon Lex V1 resources. If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead. .

End of support notice: On September 15, 2025, AWS will discontinue support for Amazon Lex V1. After September 15, 2025, you will no longer be able to access the Amazon Lex V1 console or Amazon Lex V1 resources. If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead. .

Amazon Lex stores text logs for your conversations in Amazon CloudWatch Logs. To view the logs, you can use the CloudWatch Logs console or API. For more information, see Search Log Data Using Filter Patterns and CloudWatch Logs Insights Query Syntax in the Amazon CloudWatch Logs User Guide.

To view logs using the Amazon Lex console
  1. Open the Amazon Lex console https://console.aws.amazon.com/lex.

  2. From the list, choose a bot.

  3. Choose the Settings tab, then from the left menu choose Conversation logs.

  4. Choose the link under Text logs to view the logs for the alias in the CloudWatch console.

You can also use the CloudWatch console or API to view your log entries. To find the log entries, navigate to the log group that you configured for the alias. You find the log stream prefix for your logs in the Amazon Lex console or by using the GetBotAlias operation.

Log entries for a user utterance is in multiple log streams. An utterance in the conversation has an entry in one of the log streams with the specified prefix. An entry in the log stream contains the following information.

{ "messageVersion": "1.0", "botName": "bot name", "botAlias": "bot alias", "botVersion": "bot version", "inputTranscript": "text used to process the request", "botResponse": "response from the bot", "intent": "matched intent", "nluIntentConfidence": "number", "slots": { "slot name": "slot value", "slot name": null, "slot name": "slot value" ... }, "alternativeIntents": [ { "name": "intent name", "nluIntentConfidence": "number", "slots": { "slot name": slot value, "slot name": null, "slot name": slot value ... } }, { "name": "intent name", "nluIntentConfidence": number, "slots": {} } ], "developerOverride": "true" | "false", "missedUtterance": true | false, "inputDialogMode": "Text" | "Speech", "requestId": "request ID", "s3PathForAudio": "S3 path to audio file", "userId": "user ID", "sessionId": "session ID", "sentimentResponse": { "sentimentScore": "{Positive: number, Negative: number, Neutral: number, Mixed: number}", "sentimentLabel": "Positive" | "Negative" | "Neutral" | "Mixed" }, "slotToElicit": "slot name", "dialogState": "ElicitIntent" | "ConfirmIntent" | "ElicitSlot" | "Fulfilled" | "ReadyForFulfillment" | "Failed", "responseCard": { "genericAttachments": [ ... ], "contentType": "application/vnd.amazonaws.card.generic", "version": 1 }, "locale": "locale", "timestamp": "ISO 8601 UTC timestamp", "kendraResponse": { "totalNumberOfResults": number, "resultItems": [ { "id": "query ID", "type": "DOCUMENT" | "QUESTION_ANSWER" | "ANSWER", "additionalAttributes": [ { ... } ], "documentId": "document ID", "documentTitle": { "text": "title", "highlights": null }, "documentExcerpt": { "text": "text", "highlights": [ { "beginOffset": number, "endOffset": number, "topAnswer": true | false } ] }, "documentURI": "URI", "documentAttributes": [] } ], "facetResults": [], "sdkResponseMetadata": { "requestId": "request ID" }, "sdkHttpMetadata": { "httpHeaders": { "Content-Length": "number", "Content-Type": "application/x-amz-json-1.1", "Date": "date and time", "x-amzn-RequestId": "request ID" }, "httpStatusCode": 200 }, "queryId": "query ID" }, "sessionAttributes": { "attribute name": "attribute value" ... }, "requestAttributes": { "attribute name": "attribute value" ... } }

The contents of the log entry depends on the result of a transaction and the configuration of the bot and request.

  • The intent, slots, and slotToElicit fields don't appear in an entry if the missedUtterance field is true.

  • The s3PathForAudio field doesn't appear if audio logs are disabled or if the inputDialogModefield is Text.

  • The responseCard field only appears when you have defined a response card for the bot.

  • The requestAttributes map only appears if you have specified request attributes in the request.

  • The kendraResponse field is only present when the AMAZON.KendraSearchIntent makes a request to search an Amazon Kendra index.

  • The developerOverride field is true when an alternative intent was specified in the bot's Lambda function.

  • The sessionAttributes map only appears if you have specified session attributes in the request.

  • The sentimentResponse map only appears if you configure the bot to return sentiment values.

Note

The input format may change without a corresponding change in the messageVersion. Your code should not throw an error if new fields are present.

You must have a role and policy set to enable Amazon Lex to write to CloudWatch Logs. For more information see IAM Policies for Conversation Logs.

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