Skip to content

Unable to perform Live Tail from aws cli.

0

Hi Team I am unable to trigger live-tailing from aws CLI

getting following error

~ $ aws logs start-live-tail \
>   --log-group-identifiers "arn:aws:logs:us-east-1:221693237952:log-group:test-log-group-001" \
>   --region us-east-1\
>   --debug
2025-05-28 13:11:33,563 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.27.21 Python/3.13.3 Linux/6.1.134-150.224.amzn2023.x86_64 exec-env/CloudShell exe/x86_64.amzn.2023
2025-05-28 13:11:33,563 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['logs', 'start-live-tail', '--log-group-identifiers', 'arn:aws:logs:us-east-1:221693237952:log-group:test-log-group-001', '--region', 'us-east-1', '--debug']
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_s3 at 0x7f51ea294900>
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_ddb at 0x7f51ea44e0c0>
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.configure.configure.ConfigureCommand'>>
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f51ea788cc0>
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f51ea789c60>
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0x7f51ea3dc220>
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0x7f51ea3ad120>
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.devcommands.CLIDevCommand'>>
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0x7f51ea2ad120>
2025-05-28 13:11:33,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f51ea2e56a0>>
2025-05-28 13:11:33,580 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.27.21/dist/awscli/data/cli.json
2025-05-28 13:11:33,583 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0x7f51ea388720>
2025-05-28 13:11:33,583 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0x7f51ea388a40>
2025-05-28 13:11:33,583 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0x7f51ea3889a0>
2025-05-28 13:11:33,583 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0x7f51ea388b80>
2025-05-28 13:11:33,583 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0x7f51ea388ae0>
2025-05-28 13:11:33,584 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0x7f51ea138d00>
2025-05-28 13:11:33,584 - MainThread - botocore.session - DEBUG - Setting config variable for region to 'us-east-1'
2025-05-28 13:11:33,585 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.27.21 Python/3.13.3 Linux/6.1.134-150.224.amzn2023.x86_64 exec-env/CloudShell exe/x86_64.amzn.2023
2025-05-28 13:11:33,585 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['logs', 'start-live-tail', '--log-group-identifiers', 'arn:aws:logs:us-east-1:221693237952:log-group:test-log-group-001', '--region', 'us-east-1', '--debug']
2025-05-28 13:11:33,585 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x7f51ea297ce0>
2025-05-28 13:11:33,585 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7f51eb11c400>
2025-05-28 13:11:33,585 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x7f51ea7f2840>
2025-05-28 13:11:33,586 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0x7f51ea99cc20>
2025-05-28 13:11:33,586 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7f51ea7f1da0>
2025-05-28 13:11:33,588 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/
2025-05-28 13:11:33,590 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x7f51ea38b880>
2025-05-28 13:11:33,590 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x7f51ea448860>
2025-05-28 13:11:33,616 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.27.21/dist/awscli/botocore/data/logs/2014-03-28/service-2.json
2025-05-28 13:11:33,630 - MainThread - botocore.hooks - DEBUG - Event building-command-table.logs: calling handler <function inject_tail_command at 0x7f51ea3aede0>
2025-05-28 13:11:33,631 - MainThread - botocore.hooks - DEBUG - Event building-command-table.logs: calling handler <function inject_start_live_tail_command at 0x7f51ea3c9b20>
2025-05-28 13:11:33,631 - MainThread - botocore.hooks - DEBUG - Event building-command-table.logs: calling handler <function add_waiters at 0x7f51ea2ad120>
2025-05-28 13:11:33,647 - MainThread - botocore.hooks - DEBUG - Event building-command-table.logs: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f51ea2e56a0>>
2025-05-28 13:11:33,650 - MainThread - botocore.hooks - DEBUG - Event building-command-table.logs_start-live-tail: calling handler <function add_waiters at 0x7f51ea2ad120>
2025-05-28 13:11:33,651 - MainThread - botocore.hooks - DEBUG - Event building-command-table.logs_start-live-tail: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f51ea2e56a0>>
2025-05-28 13:11:33,652 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.start-live-tail.log-group-identifiers: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f51ea2e6120>
2025-05-28 13:11:33,653 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.start-live-tail: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7f51ea3bf8c0>
2025-05-28 13:11:33,654 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.start-live-tail.log-stream-names: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f51ea2e6120>
2025-05-28 13:11:33,654 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.start-live-tail.log-stream-name-prefixes: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f51ea2e6120>
2025-05-28 13:11:33,655 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.start-live-tail.log-event-filter-pattern: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f51ea2e6120>
2025-05-28 13:11:33,655 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.start-live-tail.mode: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f51ea2e6120>
2025-05-28 13:11:33,656 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.start-live-tail: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7f51ea3bf8c0>
2025-05-28 13:11:33,657 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2025-05-28 13:11:33,657 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2025-05-28 13:11:33,658 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity
2025-05-28 13:11:33,658 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: sso
2025-05-28 13:11:33,658 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2025-05-28 13:11:33,659 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: custom-process
2025-05-28 13:11:33,659 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: config-file
2025-05-28 13:11:33,660 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: ec2-credentials-file
2025-05-28 13:11:33,660 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: boto-config
2025-05-28 13:11:33,661 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: container-role
2025-05-28 13:11:33,662 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): localhost:1338
2025-05-28 13:11:33,664 - MainThread - urllib3.connectionpool - DEBUG - http://localhost:1338 "GET /latest/meta-data/container/security-credentials HTTP/1.1" 200 1228
2025-05-28 13:11:33,666 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.27.21/dist/awscli/botocore/data/endpoints.json
2025-05-28 13:11:33,700 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x7f51eb34d760>
2025-05-28 13:11:33,716 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.27.21/dist/awscli/botocore/data/logs/2014-03-28/endpoint-rule-set-1.json
2025-05-28 13:11:33,717 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.27.21/dist/awscli/botocore/data/partitions.json
2025-05-28 13:11:33,719 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.cloudwatch-logs: calling handler <function add_generate_presigned_url at 0x7f51eb4a0220>
2025-05-28 13:11:33,720 - MainThread - botocore.configprovider - DEBUG - Looking for endpoint for logs via: environment_service
2025-05-28 13:11:33,720 - MainThread - botocore.configprovider - DEBUG - Looking for endpoint for logs via: environment_global
2025-05-28 13:11:33,721 - MainThread - botocore.configprovider - DEBUG - Looking for endpoint for logs via: config_service
2025-05-28 13:11:33,721 - MainThread - botocore.configprovider - DEBUG - Looking for endpoint for logs via: config_global
2025-05-28 13:11:33,721 - MainThread - botocore.configprovider - DEBUG - No configured endpoint found.
2025-05-28 13:11:33,724 - MainThread - botocore.endpoint - DEBUG - Setting logs timeout as (60, 60)
2025-05-28 13:11:33,725 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.cloudwatch-logs.StartLiveTail: calling handler <function base64_decode_input_blobs at 0x7f51ea7f28e0>
2025-05-28 13:11:33,726 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.cloudwatch-logs.StartLiveTail: calling handler <function generate_idempotent_uuid at 0x7f51eb34db20>
2025-05-28 13:11:33,726 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.cloudwatch-logs.StartLiveTail: calling handler <function _handle_request_validation_mode_member at 0x7f51eb3685e0>
2025-05-28 13:11:33,726 - MainThread - botocore.regions - DEBUG - Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2025-05-28 13:11:33,726 - MainThread - botocore.regions - DEBUG - Endpoint provider result: https://logs.us-east-1.amazonaws.com
2025-05-28 13:11:33,727 - MainThread - botocore.hooks - DEBUG - Event before-call.cloudwatch-logs.StartLiveTail: calling handler <function add_query_compatibility_header at 0x7f51eb368540>
2025-05-28 13:11:33,727 - MainThread - botocore.hooks - DEBUG - Event before-call.cloudwatch-logs.StartLiveTail: calling handler <function inject_api_version_header_if_needed at 0x7f51eb34f600>
2025-05-28 13:11:33,727 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=StartLiveTail) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'Logs_20140328.StartLiveTail', 'Content-Type': 'application/x-amz-json-1.1', 'User-Agent': 'aws-cli/2.27.21 md/awscrt#0.26.1 ua/2.1 os/linux#6.1.134-150.224.amzn2023.x86_64 md/arch#x86_64 lang/python#3.13.3 md/pyimpl#CPython exec-env/CloudShell cfg/retry-mode#standard md/installer#exe md/distrib#amzn.2023 md/prompt#off md/command#logs.start-live-tail'}, 'body': b'{"logGroupIdentifiers": ["arn:aws:logs:us-east-1:221693237952:log-group:test-log-group-001"]}', 'host_prefix': 'streaming-', 'url': 'https://streaming-logs.us-east-1.amazonaws.com/', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x7f51ea14eea0>, 'has_streaming_input': False, 'auth_type': None, 'unsigned_payload': None}}
2025-05-28 13:11:33,727 - MainThread - botocore.hooks - DEBUG - Event request-created.cloudwatch-logs.StartLiveTail: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f51e966ef90>>
2025-05-28 13:11:33,728 - MainThread - botocore.hooks - DEBUG - Event choose-signer.cloudwatch-logs.StartLiveTail: calling handler <function set_operation_specific_signer at 0x7f51eb34d940>
2025-05-28 13:11:33,728 - MainThread - botocore.credentials - DEBUG - Credentials need to be refreshed.
2025-05-28 13:11:33,728 - MainThread - botocore.credentials - DEBUG - Credentials need to be refreshed.
2025-05-28 13:11:33,729 - MainThread - urllib3.connectionpool - DEBUG - http://localhost:1338 "GET /latest/meta-data/container/security-credentials HTTP/1.1" 200 1228
2025-05-28 13:11:33,730 - MainThread - botocore.credentials - DEBUG - Retrieved credentials will expire at: 2025-05-28 13:23:29+00:00
2025-05-28 13:11:33,731 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2025-05-28 13:11:33,731 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.1
host:streaming-logs.us-east-1.amazonaws.com
x-amz-date:20250528T131133Z
x-amz-security-token:IQoJb3JpZ2luX2VjEK7//////////wEaCXVzLWVhc3QtMSJHMEUCIQClyHIH7hn77mGbx0Mg1IQWjFJvjgJG79Ii7nqB6+3f2QIgRWEwtYLdd81sffqxAizqfMr/R+mHwLwEV62MPVbR43Aq4wIIdhAAGgwyMjE2OTMyMzc5NTIiDD+L9cEqZp2atc+uXSrAAqzlYMnk3zPmIuozpxUd1Tb2LLovt9OMZAyia+lYfpXyUjxW1Y32m1yiGUrPTrvjLT5SyaRxXKatW5e6JvqFX0GhBaWfcSpYZyeaU70BFkRvmfqbp+HMx+yK5otbQfrXcWD32D73JQcGBt9isBPr/xnzKxo8VqKv60/md6sLXQ7vPSH0LqsYTB9cbUp8uCp8MLBIXzhTSxUT23bNW/TS+8ipOStj3bVNewrk+6rGcI+Ps
1 Answer
0

The error you're encountering with CloudWatch Logs Live Tail from the AWS CLI appears to be related to network connectivity issues. Based on the debug output, the request is being made to the streaming endpoint for CloudWatch Logs, but it seems to be getting cut off before completion.

CloudWatch Logs Live Tail requires web socket connections to function properly. If your network security team has restrictions on web sockets, you won't be able to use the Live Tail feature from the CloudWatch console. However, you should still be able to use it via the AWS CLI or APIs.

Here are some troubleshooting steps:

  1. Verify that your network allows web socket connections, which are required for Live Tail functionality.

  2. Ensure you have the correct permissions to access the specified log group.

  3. Check that the log group exists and is in the Standard log class (Live Tail is only supported for log groups in the Standard log class).

  4. Try using the CLI in interactive mode:

    aws logs start-live-tail --log-group-identifiers "your-log-group-arn" --mode interactive
    
  5. Or try the print-only mode:

    aws logs start-live-tail --log-group-identifiers "your-log-group-arn" --mode print-only
    

If you continue to experience issues, you might want to try using the SDK approach instead, which provides more control over handling the Live Tail session and any potential errors.

Sources
Troubleshoot with CloudWatch Logs Live Tail - Amazon CloudWatch Logs
Use StartLiveTail with an AWS SDK - AWS SDK Code Examples
Use StartLiveTail with an AWS SDK - Amazon CloudWatch Logs

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.