Skip to content

Generating Route53 Log console and programatic access logs to S3 bucket

0

Hi community, I was trying to send Route53 Logs for console and programmatic access to S3 bucket. I have created an EventBridge rule with the following event pattern:

{
  "source": ["aws.route53"],
  "detail-type": ["AWS API Call via CloudTrail", "AWS Console Action via CloudTrail"],
  "detail": {
    "eventSource": ["route53.amazonaws.com", "route53resolver.amazonaws.com", "route53domains.amazonaws.com"]
  }
}

This rule sends the Route53 Logs to a target Firehose stream and then to a S3 bucket. But, I can see some random symbols are getting appended at the end of my log file:

......
        "eventCategory": "Management",
        "tlsDetails": {
            "tlsVersion": "TLSv1.3",
            "cipherSuite": "TLS_AES_SOMEVALUE",
            "clientProvidedHostHeader": "route53.amazonaws.com"
        },
        "sessionCredentialFromConsole": "true"
    }
}��m��j�0E��IO�e�L�P�`�=����j0���PB��t;��a`�
�u�>��
}�``�U��2/�l�Cå�PL#��8
��4�G0�O��[�����i����0t�l�'[w``KS)h���n����f�x���ÂA�w��
};�����Ɂy��:��c�:L
]�C�o`�e��l�?�+�
@�9LI���\q��Lj�B	�HQ)��ST�H�1�Z�
�mg���KC�����`%�rRiR����P�%���?;HFV�(�y�m�O8"b)�D1��n��{���

Can someone help me in troubleshoot where was the issue or what went wrong?

1 Answer
0

The issue you're experiencing with random symbols appearing at the end of your log file is likely related to the compression of the log data. When using Amazon Kinesis Data Firehose to deliver logs to an S3 bucket, the data is often compressed by default, which can result in these seemingly random characters at the end of the file when viewed as plain text.

To resolve this issue, you have a few options:

  1. Configure Kinesis Data Firehose to disable compression. In the Firehose delivery stream settings, you can set the S3 compression format to "UNCOMPRESSED" if you want to store the logs as plain text.

  2. If you want to keep the compression (which is generally recommended for storage efficiency), you'll need to decompress the files before viewing them. The compression format is typically GZIP, so you can use appropriate tools or commands to decompress the files before analysis.

  3. Use AWS Athena or other log analysis tools that can automatically handle compressed log files, allowing you to query and analyze the data without manual decompression.

Regarding your EventBridge rule, it appears to be correctly configured to capture Route 53 API calls and console actions. However, to ensure you're capturing all relevant Route 53 logs, you might want to consider the following:

  1. Use AWS CloudTrail to create a trail that captures all Route 53 API activity. CloudTrail can be configured to deliver these logs directly to an S3 bucket.

  2. For DNS query logging, you can use Route 53's query logging feature, which allows you to log DNS queries for a hosted zone to CloudWatch Logs.

  3. If you're using Route 53 Resolver, you can enable Resolver query logging to capture DNS queries resolved by Resolver endpoints.

By implementing these additional logging methods alongside your EventBridge rule, you can ensure comprehensive coverage of Route 53 activities in your logs.
Sources
Logging Amazon Route 53 API calls with AWS CloudTrail - Amazon Route 53
Route 53 examples using Tools for PowerShell - AWS SDK Code Examples
Create an EventBridge rule for an Amazon S3 source (console) - AWS CodePipeline
S3LogDestination - Amazon EventBridge Pipes

answered a year ago

EXPERT

reviewed 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.