reopenOnTruncate

Experimental: reopen the input file if it was truncated without changing its inode.

This parameter applies to imfile: Text File Input Module.

Name:

reopenOnTruncate

Scope:

input

Type:

boolean

Default:

off

Required?:

no

Introduced:

at least 8.x, possibly earlier

Description

When activated, tells rsyslog to reopen the input file if it was truncated (the inode is unchanged but the file size on disk is smaller than the current offset in memory). The offset restored from the state file is included. After a restart, a saved offset past the end of the file makes reading start again at byte 0, so the lines that remain are read again. This feature is experimental. The default is off.

Input usage

input(type="imfile"
      File="/var/log/example.log"
      Tag="example"
      reopenOnTruncate="on")

Notes

  • Legacy documentation used the term binary for the type. It is treated as boolean.

  • This parameter is experimental and may change.

See also

See also imfile: Text File Input Module.


Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project

Contributing: Source & docs: rsyslog source project

© 2008–2026 Rainer Gerhards and others. Licensed under the Apache License 2.0.