Search code examples
jsonamazon-web-servicesloggingdownloadlegacy

How to download logs created by ECS container to make them look the old-fashined way remove JSON?


My good old application creates log caught by AWS Cloudwatch logs

However it is ugly to read them trapped inside JSON. Can I get them in a raw form?


Solution

  • Install jq (a C++ application without dependency hell) from your favourite package repository (or from GitHub).

    Download the logs and parse them with

    #profile=...
    #lgn=...
    aws --profile $profile logs get-log-events --log-stream-name
    $lsn --log-group-name /$lgn | jq --raw-output '.events[] | .message'