liveBook · Manning

Tag expansion

As explained in Logs and Telemetry

Tag expansion is the inclusion of an input file's full path and related identifying details in an event tag.

Tag expansion extends an input tag with the full file path. Path and filename elements can carry identifiers such as Pod name and container ID, which can then support metadata lookup. section 4.6.4

For a Tail input, append `.*` to the tag name, such as `basic-file.*`. Emitted tags retain the base name and render path separators as dots. section 4.6.4

Listing 4.6 Tag expansion fragment: basic-file-read-tag-expansion.conf
[INPUT]
  name tail
  path ./chapter3/basic-file.txt
  read_from_head true
  tag basic-file.*    #1

This minimal Tail configuration shows the `.*` suffix that enables full-path tag expansion. section 4.6.4

In Kubernetes log collection, a Kubernetes filter can parse the expanded tag for file-derived attributes and use them to query Kubernetes APIs for additional metadata. section 4.6.4

How Logs and Telemetry covers it

How deep it goes
Shows the tag suffix, resulting tag format, and Kubernetes-filter role; defers detailed parser and filter treatment.
Examples
Demonstrates a Tail configuration using `basic-file.*` and an emitted tag containing a dot-separated file path.
What it assumes
Assumes a file-reading input configuration and defers detailed parsers and filters for later treatment.
What you can do after
Apply it via Fluent Bit by appending `.*` to an input tag before Kubernetes metadata enrichment.
How it connects
Connects Tail and systemd inputs with the Kubernetes filter, Kubernetes APIs, DaemonSets, and log metadata.

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.