From 5446e1ffe7f07f150c05bf90bba30c1ee79ecaf5 Mon Sep 17 00:00:00 2001 From: Dmitry Romanov Date: Thu, 28 Mar 2024 15:24:56 +0700 Subject: [PATCH] watching_dir is not required --- plugin/input/file/README.md | 6 +++--- plugin/input/file/file.go | 2 +- plugin/input/file/provider_test.go | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugin/input/file/README.md b/plugin/input/file/README.md index d577bc66a..95a7a6138 100755 --- a/plugin/input/file/README.md +++ b/plugin/input/file/README.md @@ -35,13 +35,13 @@ pipelines: ``` ### Config params -**`watching_dir`** *`string`* *`required`* +**`watching_dir`** *`string`* List of included pathes -*`string`* *`required`* +*`string`* List of excluded pathes -*`string`* *`required`* +*`string`* The source directory to watch for files to process. All subdirectories also will be watched. E.g. if files have `/var/my-logs/$YEAR/$MONTH/$DAY/$HOST/$FACILITY-$PROGRAM.log` structure, `watching_dir` should be `/var/my-logs`. diff --git a/plugin/input/file/file.go b/plugin/input/file/file.go index 4ad94baae..6d0bc80ca 100644 --- a/plugin/input/file/file.go +++ b/plugin/input/file/file.go @@ -105,7 +105,7 @@ type Config struct { // > `/var/my-logs/$YEAR/$MONTH/$DAY/$HOST/$FACILITY-$PROGRAM.log` structure, `watching_dir` should be `/var/my-logs`. // > Also the `filename_pattern`/`dir_pattern` is useful to filter needless files/subdirectories. In the case of using two or more // > different directories, it's recommended to setup separate pipelines for each. - WatchingDir string `json:"watching_dir" required:"true"` // * + WatchingDir string `json:"watching_dir"` // * // > @3@4@5@6 // > diff --git a/plugin/input/file/provider_test.go b/plugin/input/file/provider_test.go index 01d2b4346..9df1142cf 100644 --- a/plugin/input/file/provider_test.go +++ b/plugin/input/file/provider_test.go @@ -86,6 +86,7 @@ func TestProvierWatcherPaths(t *testing.T) { ctl.RegisterCounter("worker1", "help_test"), ctl.RegisterCounter("worker2", "help_test"), ctl.RegisterGauge("worker3", "help_test"), + ctl.RegisterGauge("worker4", "help_test"), ) jp := NewJobProvider(config, metrics, &zap.SugaredLogger{})