Skip to content

Commit 8ec6980

Browse files
committed
Add db.compare_filename support to Tail input plugin
Signed-off-by: damanpreetsingh <damanpreetsingh@digitalocean.com>
1 parent c87e78b commit 8ec6980

8 files changed

Lines changed: 29 additions & 0 deletions

File tree

apis/fluentbit/v1alpha2/plugins/input/tail_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ type Tail struct {
6161
DBSync string `json:"dbSync,omitempty"`
6262
// Specify that the database will be accessed only by Fluent Bit.
6363
DBLocking *bool `json:"dbLocking,omitempty"`
64+
// Whether to compare filenames. When enabled, the database uses the filename for comparison.
65+
DBCompareFilename *bool `json:"dbCompareFilename,omitempty"`
6466
// Set a limit of memory that Tail plugin can use when appending data to the Engine.
6567
// If the limit is reach, it will be paused; when the data is flushed it resumes.
6668
MemBufLimit string `json:"memBufLimit,omitempty"`
@@ -148,6 +150,7 @@ func (t *Tail) Params(_ plugins.SecretLoader) (*params.KVs, error) {
148150
plugins.InsertKVField(kvs, "Read_from_Head", t.ReadFromHead)
149151
plugins.InsertKVField(kvs, "Rotate_Wait", t.RotateWaitSeconds)
150152
plugins.InsertKVField(kvs, "DB.locking", t.DBLocking)
153+
plugins.InsertKVField(kvs, "DB.compare_filename", t.DBCompareFilename)
151154
plugins.InsertKVField(kvs, "Multiline", t.Multiline)
152155
plugins.InsertKVField(kvs, "Multiline_Flush", t.MultilineFlushSeconds)
153156
plugins.InsertKVField(kvs, "Skip_Empty_Lines", t.SkipEmptyLines)

apis/fluentbit/v1alpha2/plugins/input/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_clusterinputs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,10 @@ spec:
789789
description: Specify that the database will be accessed only by
790790
Fluent Bit.
791791
type: boolean
792+
dbCompareFilename:
793+
description: Whether to compare filenames. When enabled, the database
794+
uses the filename for comparison.
795+
type: boolean
792796
dbSync:
793797
description: 'Set a default synchronization (I/O) method. Values:
794798
Extra, Full, Normal, Off.'

charts/fluent-operator/crds/fluentbit.fluent.io_clusterinputs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,10 @@ spec:
787787
description: Specify that the database will be accessed only by
788788
Fluent Bit.
789789
type: boolean
790+
dbCompareFilename:
791+
description: Whether to compare filenames. When enabled, the database
792+
uses the filename for comparison.
793+
type: boolean
790794
dbSync:
791795
description: 'Set a default synchronization (I/O) method. Values:
792796
Extra, Full, Normal, Off.'

config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,10 @@ spec:
788788
description: Specify that the database will be accessed only by
789789
Fluent Bit.
790790
type: boolean
791+
dbCompareFilename:
792+
description: Whether to compare filenames. When enabled, the database
793+
uses the filename for comparison.
794+
type: boolean
791795
dbSync:
792796
description: 'Set a default synchronization (I/O) method. Values:
793797
Extra, Full, Normal, Off.'

docs/plugins/fluentbit/input/tail.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The Tail input plugin allows to monitor one or several text files. <br /> It has
1919
| db | Specify the database file to keep track of monitored files and offsets. | string |
2020
| dbSync | Set a default synchronization (I/O) method. Values: Extra, Full, Normal, Off. | string |
2121
| dbLocking | Specify that the database will be accessed only by Fluent Bit. | *bool |
22+
| dbCompareFilename | Whether to compare filenames. When enabled, the database uses the filename for comparison. | *bool |
2223
| memBufLimit | Set a limit of memory that Tail plugin can use when appending data to the Engine. If the limit is reach, it will be paused; when the data is flushed it resumes. | string |
2324
| parser | Specify the name of a parser to interpret the entry as a structured message. | string |
2425
| key | When a message is unstructured (no parser applied), it's appended as a string under the key name log. This option allows to define an alternative name for that key. | string |

manifests/setup/fluent-operator-crd.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,6 +2964,10 @@ spec:
29642964
description: Specify that the database will be accessed only by
29652965
Fluent Bit.
29662966
type: boolean
2967+
dbCompareFilename:
2968+
description: Whether to compare filenames. When enabled, the database
2969+
uses the filename for comparison.
2970+
type: boolean
29672971
dbSync:
29682972
description: 'Set a default synchronization (I/O) method. Values:
29692973
Extra, Full, Normal, Off.'

manifests/setup/setup.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,6 +2964,10 @@ spec:
29642964
description: Specify that the database will be accessed only by
29652965
Fluent Bit.
29662966
type: boolean
2967+
dbCompareFilename:
2968+
description: Whether to compare filenames. When enabled, the database
2969+
uses the filename for comparison.
2970+
type: boolean
29672971
dbSync:
29682972
description: 'Set a default synchronization (I/O) method. Values:
29692973
Extra, Full, Normal, Off.'

0 commit comments

Comments
 (0)