log.file.overwrite¶
If set to “on”, the statistics log file specified by log.file is overwritten with each emission instead of being appended to.
This parameter applies to impstats: Generate Periodic Statistics of Internal Counters.
- Name:
log.file.overwrite
- Scope:
module
- Type:
binary
- Default:
off
- Required?:
no
- Introduced:
8.2602.0
Description¶
When this parameter is set to on, rsyslog will overwrite the file specified
in log.file every time it emits statistics. This is useful for external
monitoring tools (like Prometheus sidecars or node exporter) that expect to
read a single, consistent set of metrics from a file.
To ensure that reader processes always see a complete and consistent set of statistics, rsyslog writes the data to a temporary file first and then atomically renames it to the final destination.
Note that this parameter only has an effect if log.file is also specified.
Module usage¶
module(load="impstats"
logFile="/var/log/rsyslog-stats"
log.file.overwrite="on")
See also¶
See also impstats: Generate Periodic Statistics of Internal Counters.
Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project
Contributing: Source & docs: rsyslog source project
© 2008–2025 Rainer Gerhards and others. Licensed under the Apache License 2.0.