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 →
- Best fix: log in JSON so the stack trace is a single escaped field.
- 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
- In Vector use a
reducetransform ormultilineon the file source with a start pattern like^\d{4}-\d{2}-\d{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.
More on Logging Pipelines
Developers SSH into servers and `grep` log files to debug. You are asked to centralise logging. Where do you start?BeginnerYour app writes free-text logs like `User 42 paid 19.99 in 340ms`. Why push for structured logging, and how?BeginnerLoki ingestion is failing with `stream limit exceeded` and the ingester memory is exploding. What happened?IntermediateFluent Bit pods on busy nodes are dropping logs during traffic spikes. How do you make the pipeline lossless?IntermediateThe Elasticsearch cluster for logs goes red every Monday after the weekend batch jobs. How do you stabilise it?AdvancedFinance says the log bill doubled in a quarter. How do you cut it without losing debugging ability?Intermediate