A company needs to count unique users per client (daily, weekly, monthly) for an application that already writes all logs, including successful logins, to CloudWatch Logs via the CloudWatch agent. They want to introduce this licensing metric with the least changes to the application. Which approach accomplishes this?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a Lambda function that consumes the CloudWatch Logs stream of application logs and increments a custom CloudWatch metric with user name and client name dimensions..
Why this is the answer
The correct approach is to use a Lambda function to consume the CloudWatch Logs stream. This allows for real-time processing of log events. The Lambda function can extract the user and client names from each successful login entry and then increment a custom CloudWatch metric with these details as dimensions. This method requires no changes to the existing application, fulfilling the "least changes" requirement. Creating a CloudWatch Logs metric filter is incorrect because metric filters can only extract a single value and cannot dynamically create dimensions based on log content for unique user counting. Modifying the application to call the AWS SDK is incorrect because it violates the "least changes to the application" constraint. Configuring the CloudWatch agent to publish custom metrics is incorrect because the CloudWatch agent primarily focuses on collecting and forwarding logs and basic system metrics, not advanced log parsing and custom metric publishing with dynamic dimensions based on log content.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed