DEV Community

Cover image for View Quick Chat History with CloudWatch Logs Group
Danh Hoang Hieu Nghi
Danh Hoang Hieu Nghi

Posted on

View Quick Chat History with CloudWatch Logs Group

In this blog, we will configure a CloudWatch Log Group to receive chat history from Quick Chat Agents based on Quick User or Agent ID.


Prerequisites

  • Python 3.10+
  • AWS CLI
  • Quick Account/User
  • Ensure your IAM user/role has the permission:
    • quicksight:AllowVendedLogDeliveryForResource on resource:
    • arn:aws:quicksight:us-east-1:account_id:account/account_id

Example

My Quick resource ARN:

arn:aws:quicksight:us-east-1:123412341234:account/123412341234

  1. Create Delivery Source

Go to Cloud Watch service and click on Log Management on 'Logs" section and create a log group name "nghi-danh-test-quick-history-chat"

Cloud Watch Dashboard

Create Log Group

Created Logs Group

Next step, open AWS CloudShell to perform "configure delivery sources - delivery destination,.."

CloudShell

Create Delivery Source of QuickSuite:

aws logs put-delivery-source   --region us-east-1 --name quick-chat-source-nghi-danh  --resource-arn arn:aws:quicksight:us-east-1:account_id:account/account_id --log-type CHAT_LOGS
Enter fullscreen mode Exit fullscreen mode

Output Delivery Source

Create Delivery Destination:

aws logs put-delivery-destination \
  --region us-east-1 \
  --name quick-chat-destination-nghi-danh \
  --delivery-destination-type CWL \
  --output-format json \
  --delivery-destination-configuration destinationResourceArn="arn:aws:logs:us-east-1:account_id:log-group:nghi-danh-test-quick-history-chat:*"
Enter fullscreen mode Exit fullscreen mode

Creation delivery-destination

Connect source and destination:

aws logs create-delivery \
  --region us-east-1 \
  --delivery-source-name quick-chat-source-nghi-danh \
  --delivery-destination-arn arn:aws:logs:us-east-1:account_id:delivery-destination:quick-chat-destination-nghi-danh \
  --record-fields resource_arn event_timestamp logType accountId user_arn user_type namespace status_code conversation_id system_message_id latency time_to_first_token message_scope user_message_id user_message agent_id flow_id system_text_message surface_type web_search user_selected_resources action_connectors cited_resource file_attachment
Enter fullscreen mode Exit fullscreen mode

Result Connection

Testing Prompt on QuickSuite

After few minutes, it will appear on Log Stream "QUICK_SUITE_CHAT_LOGS"

Event Content

GitHub logo ihatesea69 / evaluation-amazon-quick-suite

Amazon Quick chat export CLI

Amazon Quick Chat Export

Simple Python script to export Amazon Quick CHAT_LOGS conversations from CloudWatch Logs Insights to CSV.

Requirements

  • Python 3.10+
  • AWS credentials with access to
    • logs:DescribeLogGroups
    • logs:StartQuery
    • logs:GetQueryResults
    • sts:GetCallerIdentity
    • quicksight:ListUsers when using --quick-user

Files

  • download_quick_conversations.py: main CLI script
  • tests/test_download_quick_conversations.py: unit and stubbed integration tests

Usage

Export chat rows to CSV:

python download_quick_conversations.py `
  --region us-east-1 `
  --log-group "your-log-group" `
  --start 2026-04-01T00:00:00Z `
  --end 2026-04-02T00:00:00Z `
  --quick-user "user@example.com" `
  --output quick_chat_logs.csv
Enter fullscreen mode Exit fullscreen mode

List distinct agent_id values only:

python download_quick_conversations.py `
  --region us-east-1 `
  --log-group "your-log-group" `
  --start 2026-04-01T00:00:00Z `
  --end 2026-04-02T00:00:00Z `
  --quick
Enter fullscreen mode Exit fullscreen mode

Use this github repo to download the the content to csv files

References Link AWS Doc

Top comments (0)