ELK Stack (Elasticsearch, Logstash, Kibana) 00:00:01 Follow one train cancellation into search A rail dispatcher reports a cancellation. The application emits a log line immediately, but support cannot yet search for it. Follow the event through shipping, optional transformation, indexing and a search refresh. The app writes the line and goes on. It does not wait for anything. The shipper reads the new line and puts it into a batch. Here Logstash extracts the event time, severity and duration and removes an unwanted token before sending the document onward. Elasticsearch stores the document in the newest index of the data stream. The answer travels back and the shipper saves its new offset. Following an Elasticsearch refresh, a query from Kibana can find the indexed event. Search visibility and durable acknowledgement do not have identical timing. An acknowledgement can prove successful ingestion at one boundary while the searchable view is still catching up. Establish which component acknowledged what before declaring that a passenger's report vanished. 00:01:00 The same cancellation appears twice The shipper hands over lines three and four. The receiving storage accepts them, but the shipper crashes before it saves the new acknowledged position. Predict which lines it will send after restarting. Lines 1 and 2 are sent and acknowledged. The offset is saved as 2. Lines 3 and 4 are sent and stored, but the shipper dies before the answer. Starting at its last confirmed offset, the shipper sends lines three and four again. With stable identifiers and a create-only indexing operation, a repeated stored identifier is rejected as a conflict. Other indexing operations can deliberately replace a document. At-least-once delivery can create repeats at exactly this boundary. A stable event identity and a suitable indexing operation can make retries harmless. Plan for file rotation and reused paths when deriving an identifier from file position. 00:01:55 Give duration a numerical type Support wants every cancellation taking longer than two seconds. A single unparsed message field is a poor basis for this comparison. Keep an event timestamp, a structured severity, a numerical duration and searchable descriptive text. Use the original event time for the event timestamp, and record ingestion time separately if the delay itself matters. An exact value. Good for filters and grouping. Map the normalized duration as a number so range filters and numerical aggregations express the intended question. The rest stays as text, split into words for search. Choose a documented duration unit. Two seconds and two thousand milliseconds should not be indexed as comparable bare numbers under the same field without normalization. Preserve the raw evidence where the retention and privacy rules allow it. 00:02:46 New events move to a new write index The railway keeps a sequence of log indices behind its data stream. A configured rollover condition is reached. Does the next event require every older document to be copied into a new index? All writes go to index 1. At the illustrated size condition, rollover points subsequent writes to a new backing index. Indices pile up. A search with a time range skips most of them. Once the configured retention conditions are met, the old backing index can be deleted. Thirty days belongs to this particular policy. The example starts a new write index and leaves earlier backing indices available for historical search. Lifecycle policies can later remove an eligible old index as a unit. Rehearse retention against a real support investigation. 00:03:36 When the intake pipe fills Events enter near one megabyte per second. Elasticsearch slows down and the processing queue begins accumulating the difference between arrival and drain rates. Track that difference rather than extrapolating only from incoming traffic. 1 MB a second comes in and goes out. Bulk requests are refused. Logstash tries again, and the queue grows. The example queue approaches its capacity after roughly eighteen minutes at the illustrated net fill rate. Additional capacity buys a finite amount of time. The shipper stays at its offset. New lines wait in the log files, as long as these are not deleted. Elasticsearch is back. The queue drains and the shipper reads on. With a full queue, shipping can stall and unread files can grow or rotate away. When storage recovers, processing must outrun continuing arrivals to reduce the backlog. Search a known cancellation after recovery to verify the whole path.