Skip to content

Instantly share code, notes, and snippets.

@soloradish
Created September 12, 2018 02:25
Show Gist options
  • Select an option

  • Save soloradish/e9a2f2188d147bfa3e73fe63bbdf890a to your computer and use it in GitHub Desktop.

Select an option

Save soloradish/e9a2f2188d147bfa3e73fe63bbdf890a to your computer and use it in GitHub Desktop.

Revisions

  1. soloradish created this gist Sep 12, 2018.
    24 changes: 24 additions & 0 deletions vault_logrotate
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    # Change the path below to your own audit log path.
    /var/log/vault/audit.log {
    rotate 30
    daily
    # Do not execute rotate if the log file is empty.
    notifempty
    missingok
    compress
    # Set compress on next rotate cycl to prevent entry loss when performing compression.
    delaycompress
    postrotate
    # If you do not use systemctl. you can send SIGHUP to vault's process to achieve same goal.
    /usr/bin/systemctl reload vault 2> /dev/null || true
    endscript
    extension log
    dateext
    dateformat %Y-%m-%d.
    }

    # Use this setting, your audit folder will like
    # .
    # ├── audit.2018-09-10.log.gz
    # ├── audit.2018-09-11.log
    # └── audit.log