Interview Prep/Monitoring & Observability/Logging: ELK/EFK, Loki & Log Shippers

Why is multiline logging a problem and how do you handle it?

IntermediateConceptLogging: ELK/EFK, Loki & Log Shippers
Answer

Stack traces span many lines; a line-based shipper turns one exception into 40 separate log events, breaking search and alerting.

Fixes, best first:

  1. Log JSON with the stack trace as one escaped field.
  2. Configure multiline parsing in the agent: Fluent Bit multiline.parser java,python,go or a custom regex start-state; Filebeat multiline.pattern; OTel filelog receiver multiline.line_start_pattern.
All Monitoring & Observability questions Roadmap: Logging & tracing

More on Logging: ELK/EFK, Loki & Log Shippers