log file size is different when downloaded using console and cli

0

I am trying to download log file of writer instance using aws cli. So for that I am using 'download-db-log-file-portion' command like this:

aws rds download-db-log-file-portion
--db-instance-identifier instance_name
--log-file-name error/postgresql.log.2023-09-26-0300.gz
--starting-token 0
--output text >> directory_path

This rds instance has .gz extension log files. On console, I can see the log file size as 25mb but when I download it via the above command, the downloaded file size is of 223mb. Does anyone know what could be the reason behind this and how do I download the log file of 25mb?

1개 답변
0

Hello.

Log files in RDS are typically stored in a compressed format (e.g., .gz for gzip compression). When you view the file size in the AWS Management Console, it may be showing the compressed size, whereas when you download it using the AWS CLI, it might be decompressed on-the-fly. To download the log file in its original compressed format, you should try removing the --output text option and specify the output file name with the .gz extension to ensure it remains compressed. Here's an example:

aws rds download-db-log-file-portion \
--db-instance-identifier instance_name \
--log-file-name error/postgresql.log.2023-09-26-0300.gz \
--starting-token 0 \
--output-directory directory_path

Best regards, Andrii

profile picture
전문가
답변함 7달 전
profile pictureAWS
전문가
검토됨 7달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠