A security team needs every application log event that matches a pattern delivered within seconds to an Amazon Data Firehose stream, which loads a central analytics bucket. The team does not want to write or run any code. Which CloudWatch Logs configuration should the operations engineer use?
Choose one.
Subscription filters stream matching log events from a log group to Kinesis Data Streams, Amazon Data Firehose or Lambda in near real time. Metric filters produce numbers; export tasks are batch copies to S3.
The requirement is to move the events themselves, within seconds, with no code. A subscription filter that targets the Firehose stream directly does exactly that. Routing through a Lambda function also works but adds code. The metric-stream option is tempting because it ends at Firehose, but it delivers metrics, not log events; export tasks are batch and slow.
- Decide whether the destination needs the events or a count: here, the events.
- Note the latency: within seconds rules out batch exports.
- Choose the feature that delivers matching events to Firehose: a subscription filter.
Exam tip: Need the log events somewhere else in near real time: subscription filter. Need a number to alarm on: metric filter.
CloudWatch Metrics, Alarms, and Log Filters for SOA-C03 — the lesson that teaches this.