Chapter 95: Logging with Loki, Elastic Stack and CloudWatch
95.17 Troubleshooting missing, delayed and duplicate logs
Story (fictional teaching scenario). At a fictional Kochi shop, Maya and Luca from Rome trace one synthetic marker through the pipeline rather than opening permissions broadly.
Why
A repeatable route check is safer than guessing that the query or collector is always at fault.
What
- Missing means expected events cannot be found in the intended scope.
- Delayed means event time and arrival/visibility time are separated.
- A rejected record failed validation or ingestion constraints.
- A positions file stores collector read offsets; changing its state can cause missed or repeated reads.
How
-
Check that the producer emitted a complete record/newline.
-
Check source selection and read offsets without reading unrelated logs.
-
Check parsing/rejection and queue counters.
-
Check destination permissions and ingestion errors with the responsible operator.
-
Check the exact label/index/group and both time selection and timezone.
Example 1: One synthetic marker
- Read the command or request.
Marker request_id=req-demo-004
Producer count=1
Collector parsed=1
Storage accepted=1
Query visible=0
- Read the result.
Output (illustrative; NOT executed against Loki, Elastic or CloudWatch)
Investigate query scope/time/field interpretation before widening access.
- Line by line: The counts are fictional diagnostics. If storage accepted zero, investigate a different boundary. Do not clear positions files as a casual fix: resetting to the beginning can duplicate events, while restarting at the end can skip them.
Ravindra Bagale's Tip
Fix the boundary that failed, not every permission.
जिथे failure आहे तो boundary दुरुस्त करा; सगळ्या permissions बदलू नका.
जिस boundary पर failure है उसे ठीक करो, सारी permissions मत बदलो.
Did you understand? Let us try it once more.