diff --git a/pkg/config/schema/core_schema.yaml b/pkg/config/schema/core_schema.yaml index 3685a4a90833..86699a8d45b5 100644 --- a/pkg/config/schema/core_schema.yaml +++ b/pkg/config/schema/core_schema.yaml @@ -2253,7 +2253,7 @@ properties: file_scan_period: node_type: setting type: number - default: 10 + default: 1 tags: - golang_type:float64 fingerprint_config: diff --git a/pkg/config/setup/common_settings.go b/pkg/config/setup/common_settings.go index 58b8541290dd..71cdcf8c4675 100644 --- a/pkg/config/setup/common_settings.go +++ b/pkg/config/setup/common_settings.go @@ -1882,7 +1882,7 @@ func logsagent(config pkgconfigmodel.Setup) { // could happen while serializing large objects on log lines. config.BindEnvAndSetDefault("logs_config.aggregation_timeout", 1000) // Time in seconds - config.BindEnvAndSetDefault("logs_config.file_scan_period", 10.0) + config.BindEnvAndSetDefault("logs_config.file_scan_period", 1.0) // Controls how wildcard file log source are prioritized when there are more files // that match wildcard log configurations than the `logs_config.open_files_limit` diff --git a/releasenotes/notes/reduce-logs-file-scan-default-0204c0b75e19f3d0.yaml b/releasenotes/notes/reduce-logs-file-scan-default-0204c0b75e19f3d0.yaml new file mode 100644 index 000000000000..2fefd8c8ceb2 --- /dev/null +++ b/releasenotes/notes/reduce-logs-file-scan-default-0204c0b75e19f3d0.yaml @@ -0,0 +1,4 @@ +--- +enhancements: + - | + The default for ``logs_config.file_scan_period`` is now **1** second instead of 10, so the Agent discovers new and rotated log files on disk more quickly. Set ``logs_config.file_scan_period`` explicitly if you need a slower scan to reduce filesystem load (for example on network file systems).