LexV2 Logs
Use the AWS Lambda archive to send user input that routes to the Lex FallbackIntent to NeuralSeek.
Step by step instruction
- Navigate to Amazon Cloudwatch Log Groups.
- Make sure you are in the same region as your bot.
- Click “Create log group”.
- Give the log group a name (this will be logs of your bot’s chat).
- Click “Create”.
- Open the Amazon LexV2 console.
- From the list, choose a bot and select the link on the name.
- From the left menu, choose Aliases.
- In the list of aliases, choose the alias for which you want to configure conversation logs.
- In the Conversation logs section, choose Manage conversation logs.
- For text logs, choose Enable then enter the log group name from the group you created earlier.
- Choose Save to start logging conversations. If necessary, Amazon LexV2 will update your service role with permissions to access the CloudWatch Logs log group and selected S3 bucket.
- Open the Functions page on the Lambda console.
- Select “Create function”.
- Create a function from scratch.
- In the Code Source pane, choose Upload from and then .zip file (upload the zip file from the bottom of the page).
- Choose Upload to select your Lambda Archive .zip file.
- Choose Save.
- Click on index.mjs and enter your API key and instance URL
- LogGroupName is the name you gave to the log group that you created earlier.
- Click “Deploy”
- Select “Configuration” tab
- Select “General Configuration” pane
- Click “Edit”
- Update under Timeout, set min to be 5 and sec to be 0
- Click “Save”
- Select “Permissions” pane
- Click on the link under “Role name”
- Click “Add permissions”
- Click “Attach policies”
- Search for “CloudWatchReadOnlyAccess”
- Select the box next to “CloudWatchReadOnlyAccess”
- Click “Add permissions”
- Navigate to the Amazon EventBridge Rules page.
- Click “Create rule”
- Give the rule a name.
- Select “Schedule” under Rule type.
- Click “Continue to create rule”.
- Select “A schedule that runs at a regular rate, such as every 10 minutes.” under Schedule pattern.
- Under Rate expression set the “Value” to be 15 and the “Unit, e.g. mins, hours…” to be Minutes.
- Click “Next”.
- Under “Select a target” select Lambda function.
- Under “Function” select the lambda we created earlier.
- Click “Next”.
- Click “Next”.
- Click “Create rule”.
- Validate the connection by triggering an intent in the language tab in AWS LexV2. You will see a icon appear next to the corresponding Intent on the “Curate” tab in NeuralSeek after the next Amazon EventBridge run (the rule will run every 15 minutes).