Skip to content
34 changes: 34 additions & 0 deletions pipeline/inputs/tail.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
| `tag_regex` | Set a regular expression to extract fields from the filename. For example: `(?<pod_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<container_id>[a-z0-9]{64})\.log$`. | _none_ |
| `static_batch_size` | Set the maximum number of bytes to process per iteration for the monitored static files (files that already exist upon Fluent Bit start). | `50M` |
| `file_cache_advise` | Set the `posix_fadvise` in `POSIX_FADV_DONTNEED` mode. This reduces the usage of the kernel file cache. This option is ignored if not running on Linux. | `on` |
| `keep_file_handle` | Keep file handles open while tailing files. When set to `false`, file handles are closed after reading, which is useful for SMB/SAMBA storage backends that prevent file deletion when handles are open. **Note:** When set to `false`, log rotation detection does not work as it requires an active handle to determine where the original file was rotated to. Rotation will be detected as a truncation, so some logs might be lost. | `true` |

Check warning on line 40 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Contractions] Feel free to use 'doesn't' instead of 'does not'. Raw Output: {"message": "[FluentBit.Contractions] Feel free to use 'doesn't' instead of 'does not'.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 40, "column": 282}}}, "severity": "INFO"}

Check warning on line 40 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Acronyms] Spell out 'SAMBA', if it's unfamiliar to the audience. Raw Output: {"message": "[FluentBit.Acronyms] Spell out 'SAMBA', if it's unfamiliar to the audience.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 40, "column": 155}}}, "severity": "INFO"}

Check warning on line 40 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Acronyms] Spell out 'SMB', if it's unfamiliar to the audience. Raw Output: {"message": "[FluentBit.Acronyms] Spell out 'SMB', if it's unfamiliar to the audience.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 40, "column": 151}}}, "severity": "INFO"}

Check warning on line 40 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Simplicity] Avoid words like "useful" that imply ease of use, because the user may find this action difficult. Raw Output: {"message": "[FluentBit.Simplicity] Avoid words like \"useful\" that imply ease of use, because the user may find this action difficult.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 40, "column": 140}}}, "severity": "WARNING"}
Comment thread
david-garcia-garcia marked this conversation as resolved.
Outdated
| `fstat_interval_nsec` | Set the interval for checking file status (`fstat`). This controls how often file metadata is checked, which is important for cloud storage backends that are sensitive to IOPS (Input/Output Operations Per Second). The value accepts time units (for example, `1s`, `500ms`, `1000000000ns`) and will be converted to nanoseconds internally. | `250ms` |

Check warning on line 41 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Acronyms] Spell out 'IOPS', if it's unfamiliar to the audience. Raw Output: {"message": "[FluentBit.Acronyms] Spell out 'IOPS', if it's unfamiliar to the audience.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 41, "column": 198}}}, "severity": "INFO"}
| `threaded` | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |
| `Unicode.Encoding` | Set the Unicode character encoding of the file data. This parameter requests two-byte aligned chunk and buffer sizes. If data isn't aligned for two bytes, Fluent Bit will use two-byte alignment automatically to avoid character breakages on consuming boundaries. Supported values: `UTF-16LE`, `UTF-16BE`, and `auto`. | `none` |
| `Generic.Encoding` | Set the non-Unicode encoding of the file data. Supported values: `ShiftJIS`, `UHC`, `GBK`, `GB18030`, `Big5`, `Win866`, `Win874`, `Win1250`, `Win1251`, `Win1252`, `Win2513`, `Win1254`, `Win1255`, and `Win1256`. | `none` |
Expand Down Expand Up @@ -474,6 +476,38 @@

{% endhint %}

## Tailing files from SMB/SAMBA

Check warning on line 479 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Acronyms] Spell out 'SAMBA', if it's unfamiliar to the audience. Raw Output: {"message": "[FluentBit.Acronyms] Spell out 'SAMBA', if it's unfamiliar to the audience.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 479, "column": 27}}}, "severity": "INFO"}

Check warning on line 479 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Acronyms] Spell out 'SMB', if it's unfamiliar to the audience. Raw Output: {"message": "[FluentBit.Acronyms] Spell out 'SMB', if it's unfamiliar to the audience.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 479, "column": 23}}}, "severity": "INFO"}

Check warning on line 479 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Headings] 'Tailing files from SMB/SAMBA' should use sentence-style capitalization. Raw Output: {"message": "[FluentBit.Headings] 'Tailing files from SMB/SAMBA' should use sentence-style capitalization.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 479, "column": 4}}}, "severity": "INFO"}
Comment thread
david-garcia-garcia marked this conversation as resolved.
Outdated

When tailing files from SMB/SAMBA shares on POSIX systems or Kubernetes CSI volume mounts, file handles can prevent file deletion. Although the `FILE_SHARE_DELETE` flag is supported on Windows, it's not available on POSIX systems or when using intermediate abstractions such as Kubernetes CSI volume mounts. Set `keep_file_handle` to `false` to allow file deletion while files are being tailed. Note that this disables log rotation detection.

Check failure on line 481 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.DontUse] We don't use 'Note that'. Raw Output: {"message": "[FluentBit.DontUse] We don't use 'Note that'.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 481, "column": 396}}}, "severity": "ERROR"}

Check warning on line 481 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Acronyms] Spell out 'SAMBA', if it's unfamiliar to the audience. Raw Output: {"message": "[FluentBit.Acronyms] Spell out 'SAMBA', if it's unfamiliar to the audience.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 481, "column": 29}}}, "severity": "INFO"}

Check warning on line 481 in pipeline/inputs/tail.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Acronyms] Spell out 'SMB', if it's unfamiliar to the audience. Raw Output: {"message": "[FluentBit.Acronyms] Spell out 'SMB', if it's unfamiliar to the audience.", "location": {"path": "pipeline/inputs/tail.md", "range": {"start": {"line": 481, "column": 25}}}, "severity": "INFO"}
Comment thread
david-garcia-garcia marked this conversation as resolved.
Outdated

Example configuration:

{% tabs %}
{% tab title="fluent-bit.yaml" %}

```yaml
pipeline:
inputs:
- name: tail
path: /mnt/samba/logs/*.log
keep_file_handle: false
fstat_interval_nsec: 1s
```

{% endtab %}
{% tab title="fluent-bit.conf" %}

```text
[INPUT]
Name tail
Path /mnt/samba/logs/*.log
Keep_File_Handle false
Fstat_Interval_Nsec 1s
```

{% endtab %}
{% endtabs %}

## Character encoding conversion

This feature allows Fluent Bit to convert logs from various character encodings into the standard UTF-8 format.
Expand Down
Loading