A security engineer needs to analyze Apache web server access logs that are stored in an Amazon S3 bucket. The logs were generated by Amazon EC2 web servers that have the Amazon CloudWatch agent installed. The engineer will use Amazon Athena to analyze the logs. The query must identify IP addresses that attempted and failed to access restricted content at the /admin URL path and must also identify the URLs those IP addresses attempted to access. Which query will meet these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: SELECT client_ip, client_request FROM logs WHERE client_request LIKE '%/admin%' AND server_status = '403';.
Why this is the answer
The correct query identifies IP addresses (clientip) and the full request (clientrequest) for attempts to access the /admin path that resulted in a 403 Forbidden status code. The LIKE '%/admin%' condition correctly filters for requests containing /admin, and serverstatus = '403' identifies failed access to restricted content. The second option is incorrect because it filters for 401 Unauthorized, not 403 Forbidden, and only selects clientip without the requested URLs. The third option is incorrect because it doesn't filter for the /admin path and includes clientid, which isn't requested. The fourth option is incorrect because it filters for 401 Unauthorized and userid < 'admin', which is not relevant to identifying failed access to the /admin URL path.
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