HDFS audit destination file rollover configuration properties

File rollover properties ensure audit files do not grow indefinitely and help with file management and processing.

file.rollover.sec
  • Property: xasecure.audit.destination.hdfs.file.rollover.sec

  • Default: 86400 (24 hours)

  • Description: Age of the audit log file in seconds after which it will be rolled over to a new file.

  • Examples:

    # 1 hour
    xasecure.audit.destination.hdfs.file.rollover.sec=3600
    
    # 6 hours
    xasecure.audit.destination.hdfs.file.rollover.sec=21600
    
    # 1 day (default)
    xasecure.audit.destination.hdfs.file.rollover.sec=86400
    
    # 1 week
    xasecure.audit.destination.hdfs.file.rollover.sec=604800
  • Note: This property is used as a fallback if file.rollover.period cannot be computed or is not specified.
file.rollover.period
  • Property: xasecure.audit.destination.hdfs.file.rollover.period

  • Default: None (uses file.rollover.sec instead)

  • Description: Time-based rollover period using calendar-aware intervals. This is preferred over file.rollover.sec as it provides calendar-aligned rollover.

  • Format: <number><unit>

  • Supported Units:

    • m - Minutes

    • h - Hours

    • d - Days

    • w - Weeks

    • M - Months

    • y - Years

  • Examples:
    # 10 minutes
    xasecure.audit.destination.hdfs.file.rollover.period=10m
    
    # 1 hour
    xasecure.audit.destination.hdfs.file.rollover.period=1h
    
    # 6 hours
    xasecure.audit.destination.hdfs.file.rollover.period=6h
    
    # 1 day (rolls at midnight)
    xasecure.audit.destination.hdfs.file.rollover.period=1d
    
    # 1 week (rolls at start of week)
    xasecure.audit.destination.hdfs.file.rollover.period=1w
    
    # 1 month (rolls at start of month)
    xasecure.audit.destination.hdfs.file.rollover.period=1M
    
    # 1 year (rolls at start of year)
    xasecure.audit.destination.hdfs.file.rollover.period=1y
  • Behavior:
    • Calendar-aligned: Rollover happens at the start of the next period boundary

      • 1d rolls at midnight

      • 1w rolls at the start of the week (typically Sunday or Monday based on locale)

      • 1M rolls at the 1st day of the month at 00:00:00

      • 1y rolls at January 1st at 00:00:00

    • If this property cannot be parsed or computed, the system falls back to file.rollover.sec

file.rollover.enable.periodic.rollover
  • Property: xasecure.audit.destination.hdfs.file.rollover.enable.periodic.rollover

  • Default: false

  • Description: Enable periodic background task to check and perform file rollover.

  • Usage: Enable this if you want automatic rollover checks even when no audit events are being generated.

    xasecure.audit.destination.hdfs.file.rollover.enable.periodic.rollover=true
  • Note: Without this enabled, rollover only happens when new audit events arrive. In low-traffic scenarios, files might not roll over on time.
file.rollover.periodic.rollover.check.sec
  • Property: xasecure.audit.destination.hdfs.file.rollover.periodic.rollover.check.sec

  • Default: 60 (seconds)

  • Description: Frequency (in seconds) at which the periodic rollover task checks if a rollover is needed.

  • Prerequisite: Requires file.rollover.enable.periodic.rollover=true

    xasecure.audit.destination.hdfs.file.rollover.enable.periodic.rollover=true
    xasecure.audit.destination.hdfs.file.rollover.periodic.rollover.check.sec=60
  • Use Cases:
    • Ensure timely rollover in low-activity environments

    • Maintain consistent file boundaries for batch processing

    • Meet compliance requirements for time-based file rotation