Skip to content

Commit 2a4ce32

Browse files
tail: ensure db file is unique (#2070)
* tail: ensure db file is unique Signed-off-by: Patrick Stephens <[email protected]> * fix: resolve review comments Signed-off-by: Patrick Stephens <[email protected]> * fix: resolve review comments Signed-off-by: Patrick Stephens <[email protected]> --------- Signed-off-by: Patrick Stephens <[email protected]>
1 parent a9b0ef4 commit 2a4ce32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pipeline/inputs/tail.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The plugin supports the following configuration parameters:
2222
| `ignore_older` | Ignores files older than `ignore_older`. Supports `m`, `h`, `d` (minutes, hours, days) syntax. | Read all. |
2323
| `skip_long_lines` | When a monitored file reaches its buffer capacity due to a very long line (`buffer_max_size`), the default behavior is to stop monitoring that file. `skip_long_lines` alter that behavior and instruct Fluent Bit to skip long lines and continue processing other lines that fit into the buffer size. | `off` |
2424
| `skip_empty_lines` | Skips empty lines in the log file from any further processing or output. | `off` |
25-
| `db` | Specify the database file to keep track of monitored files and offsets. | _none_ |
25+
| `db` | Specify the database file to keep track of monitored files and offsets. Recommended to be unique per plugin. | _none_ |
2626
| `db.sync` | Set a default synchronization (I/O) method. This flag affects how the internal SQLite engine do synchronization to disk, for more details about each option see [the SQLite documentation](https://www.sqlite.org/pragma.html#pragma_synchronous). Most scenarios will be fine with `normal` mode. If you need full synchronization after every write operation set `full` mode. `full` has a high I/O performance cost. Values: `extra`, `full`, `normal`, `off`. | `normal` |
2727
| `db.locking` | Specify that the database will be accessed only by Fluent Bit. Enabling this feature helps increase performance when accessing the database but restricts externals tool from querying the content. | `false` |
2828
| `db.journal_mode` | Sets the journal mode for databases (`wal`). Enabling `wal` provides higher performance. `wal` isn't compatible with shared network file systems. | `wal` |
@@ -75,6 +75,8 @@ If no database file is present, positioning behavior depends on the value of `re
7575
- When `read_from_head` is `true`, the plugin reads from the beginning of the file.
7676
- When `read_from_head` is `false`, the plugin starts monitoring from the end of the file (classic "tail" behavior). This means that only new content written after Fluent Bit starts will be monitored.
7777

78+
The database file essentially stores `inode=offset` so it should be unique per instance of the plugin, for example if you have two tail inputs then use two separate `db` files for each. That way each tail input can independently track its own state.
79+
7880
## Monitor a large number of files
7981

8082
To monitor a large number of files, you can increase the `inotify` settings in your Linux environment by modifying the following `sysctl` parameters:

0 commit comments

Comments
 (0)