The Fluent Bit tail input plugin reads records from files. Like Linux `tail -f`, it can begin at a file’s head and follow later appends. Configure file locations and, when restart continuity matters, DB-prefixed settings that record reading progress. section 3.5
A basic file-ingestion setup chooses how the input is located and consumed:
- Set `path` to select the file; use `exclude_path` to avoid unwanted neighbors such as compressed archives. section 3.5.1
- Set a `tag` explicitly when each line is handled as an unstructured string. section 3.5.1
- Use `read_from_head true` to ingest existing contents rather than only new appends, and `exit_on_eof true` for a bounded file-read run. section 3.5.1
Listing 3.4 Illustrating a file tail: basic-file-read.conf
[SERVICE] flush 1 [INPUT] name tail #1 path ./basic-file.txt #2 read_from_head true #3 exit_on_eof true #4 tag basic-file #5 [OUTPUT] name stdout match *
This minimal configuration reads `./basic-file.txt` from the start, labels records `basic-file`, writes them to stdout, and exits at end of file. section 3.5.1
Parsing can happen directly at the tail input. Supplying a parser avoids serializing events to MessagePack and deserializing them again for a separate parse step, reducing processing and buffer overhead—especially when buffers use file storage. section 6.11
Parse while reading
A tail input can read `./codedJSON.log`, tag records `codedFeed`, and set `parser myJSONDecodedUTF`. The parsed events then go directly to stdout without a separate parsing filter. section 6.11
For application stdout that would otherwise be piped directly into Fluent Bit, writing to a log file and tailing it can be an alternative. Keep parsing simple, use buffering where needed, and use log rotation when files grow unwieldy. section 3.3.2
