An application logs processing metrics to Amazon CloudWatch Logs in JSON format. A developer needs to write an Amazon CloudWatch Logs Insights query to analyze application performance. The query must only include log events where the `durationMs` field is present. Additionally, the query must calculate both the average and the 95th percentile of `durationMs` grouped in 10-minute intervals. Which TWO CloudWatch Logs Insights query clauses must the developer include to meet these requirements?
- filter ispresent(durationMs)Answer
- stats avg(durationMs), pct(durationMs, 95) by bin(10m)Answer
- Cfilter durationMs exists
- Dstats mean(durationMs), pct(durationMs, 95) by bin(10m)
- Estats avg(durationMs), pct(durationMs, 95) by 10m
Answer
The correct query clauses are the filter clause with the ispresent function and the stats clause using the avg and pct functions grouped by the bin function.
The filter clause utilizing the ispresent function correctly filters for events where the specific field exists. The stats clause correctly calculates the average using avg and the percentile using pct, and groups them in 10-minute buckets using the bin function.
Step-by-Step Solution
Key Concept
Writing syntactically correct CloudWatch Logs Insights queries to filter and aggregate log data.