A Java stack trace shows up in Kibana as 40 separate log events. How do you fix it?

BeginnerScenarioLogging Pipelines
Answer

Situation read → The shipper treats every newline as a new event, so multi-line exceptions are split.

What I'd do →

  1. Best fix: log in JSON so the stack trace is a single escaped field.
  2. If you cannot change the app, configure multi-line parsing in the shipper. Fluent Bit:
[INPUT]
    Name              tail
    Path              /var/log/containers/*.log
    multiline.parser  docker, cri, java
  1. In Vector use a reduce transform or multiline on the file source with a start pattern like ^\d{4}-\d{2}-\d{2}.
  2. Verify with a test exception before rolling out.

Why → One exception = one event makes counting and alerting on errors possible.

Interview tip → Mention that container runtimes split long lines at 16 KB, which needs the cri/docker parser to rejoin.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Logging Pipelines