liveBook · Manning

Timestamp

As explained in Logs and Telemetry

A timestamp is a time value associated with an event to indicate when it occurred or was received.

A timestamp associates an event with the time it occurred or entered a pipeline. It makes events operationally useful: teams can tell whether an issue is current, establish ordering, and distinguish possible causes from effects. Inputs can extract a timestamp from event content or assign the receive time. section 1.2.1

In Fluent Bit event handling, the timestamp travels separately from the tag and record. A Lua filter receives tag, timestamp, and record, then returns a status code with the timestamp and record. The default timestamp representation is a decimal seconds.nanoseconds value; a log field such as `time` remains ordinary record data unless an input uses it as the event timestamp. section 7.6.2 section 1.2.1

Treat timestamps as a configuration and capacity concern for time-based processing:

  • Choose window durations with buffer capacity in mind. Sparse traffic can create empty windows, while incident surges can require more memory and otherwise risk data loss. section 8.4.3
  • Keep sources on one time zone and avoid daylight-saving shifts in stream-processing timestamps. Preserve required local times as clearly named payload fields instead. section 8.4.3
  • Align window intervals with event frequency. Millisecond precision and multithreaded scheduling can exclude events near a window boundary. section 8.4.1

Inspecting timestamps in a Lua filter

A Lua callback can accept `cb_addElementCount(tag, timestamp, record)` while changing only the record. Returning response code `2` tells Fluent Bit that the record changed and the timestamp did not. With `time_as_table: true`, a callback can inspect timestamp seconds and nanoseconds as separate values. section 7.6.2 section 7.6.2

Timestamp-sensitive hopping window

A dummy input emitting one event per second can feed a four-second hopping window advanced every two seconds. Small variations in event timestamps can change which records enter each sum, producing results that differ from the ideal count. section 8.4.1

Figure 8.2 Visualization of a sliding or hopping window in terms of how it sees the data
figure

Use the window visualization to see why timestamp boundaries determine which events a hopping calculation includes. section 8.4.1

How Logs and Telemetry covers it

How deep it goes
Explains timestamp assignment, Lua’s seconds.nanoseconds representation, and window-boundary behavior without detailing timestamp parsing formats.
Examples
Demonstrates Lua callbacks that preserve timestamps and a one-second dummy stream aggregated through a hopping window.
What it assumes
Assumes familiarity with Fluent Bit inputs, records, and filters while illustrating timestamp handling through runnable Lua and stream configurations.
What you can do after
Operate/configure it by selecting input timestamps, preserving them through Lua filters, and sizing time windows around event rates.
How it connects
Connects timestamps to event metadata, tags, records, Lua filters, stream processors, hopping windows, buffering, and time zones.

Also explained in

Compare how 10 books explain timestamp →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Logs and Telemetry. The section links point to the parts of the book it draws on.