Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
securityonion-elastic: rotate /var/log/nsm/so-curator-closed-delete.l…
Browse files Browse the repository at this point in the history
…og #1370
  • Loading branch information
dougburks committed Nov 14, 2018
1 parent 24f18a6 commit 84723d9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions usr/sbin/so-curator-closed-delete
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ log="/var/log/nsm/so-curator-closed-delete.log"
index_usage=$(du -s /nsm/elasticsearch/nodes/0/indices | awk '{print $1}')
usage_gb=$(($index_usage / 10**6))

# If logrotate script doesn't already exist, create it
FILE="/etc/logrotate.d/so-curator-closed-delete"
if ! [ -f ${FILE} ]; then
cat << EOF > ${FILE}
/var/log/nsm/so-curator-closed-delete.log {
daily
rotate 7
copytruncate
compress
missingok
notifempty
}
EOF
fi

while [[ "$usage_gb" -ge "$LOG_SIZE_LIMIT" ]]; do

# Create an array for index key and name
Expand Down

0 comments on commit 84723d9

Please sign in to comment.