You have a set of web servers hosted in AWS which host a web application used by a section of users.
You want to monitor the number of errors which occur when using the web application.
Which of the below options can be used for this purpose.
Choose 3 answers from the options given below.
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - A,C and D.
The AWS documentation mentions the following.
You use metric filters to search for and match terms, phrases, or values in your log events.
When a metric filter finds one of the terms, phrases, or values in your log events, you can increment the value of a CloudWatch metric.
For example, you can create a metric filter to search for and count the occurrence of the word ERROR in your log events.
For more information on Cloudwatch logs - Filter and pattern matching , please refer to the below link:
http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.htmlTo monitor the number of errors occurring in a web application hosted on AWS, the following options can be considered:
A. Send the logs from the instances onto Cloudwatch logs: By configuring the AWS CloudWatch Logs agent on the web servers, the logs can be sent to CloudWatch Logs. The logs can then be analyzed using CloudWatch Insights or other third-party tools. This approach allows for centralized logging and monitoring of the logs, which can help identify errors in real-time and allow for quick debugging.
B. Search for the keyword "ERROR" in the log files on the server: This approach involves logging into each server individually and searching for the keyword "ERROR" in the log files. While this approach can provide a quick solution for a small number of servers, it can become tedious and time-consuming as the number of servers grows. Additionally, this approach does not provide centralized logging and monitoring, and it can be difficult to track and analyze the errors.
C. Search for the keyword "ERROR" in Cloudwatch logs: If the logs are sent to CloudWatch Logs, then it is possible to search for the keyword "ERROR" directly in the CloudWatch Logs console. This approach provides centralized logging and monitoring of the logs and allows for quick debugging of errors.
D. Increment a metric filter in CloudWatch whenever the pattern is matched: Using CloudWatch Metrics, it is possible to create a custom metric filter that increments a counter whenever a specific pattern is matched in the logs. This approach allows for real-time monitoring of the errors and can provide insight into the frequency and severity of the errors. However, this approach requires additional configuration and may not be as useful for debugging as the other options.
In summary, the recommended options for monitoring the number of errors occurring in a web application hosted on AWS are to send the logs to CloudWatch Logs (option A) and search for the keyword "ERROR" in CloudWatch Logs (option C). Optionally, incrementing a metric filter in CloudWatch (option D) can provide additional insight into the frequency and severity of the errors.