Monitoring, Logging, Analysis, Remediation, and Performance Optimization

A Java application's log file contains timestamped entries followed by stack traces without timestamps. The CloudWatch agent sends each stack-trace line as a separate event. Which setting should group each entry and its stack trace?

Show the answer

Correct answerD. Set multi_line_start_pattern to match each timestamped entry's first line.

AWhy not this: The flush interval controls delivery timing, not how lines are grouped into events.

BWhy not this: A log stream name controls the destination stream, not event boundaries within a file.

CWhy not this: timestamp_format controls timestamp parsing rather than grouping lines into events.

DWhy this is right: Matching the first line identifies each new event and groups subsequent continuation lines with it.

multi_line_start_pattern identifies the beginning of a new event, allowing following stack-trace lines to remain part of that event. timestamp_format parses event timestamps but does not define multiline event boundaries.