Regularly Export Activities
Initial Setup
Create an Admin Token
chown sdm:sdm /etc/sdm-admin.tokenExample Activity Export Script
#!/bin/bash
export SDM_ADMIN_TOKEN=<insert admin token here>
START=$(date -d "5 minutes ago" '+%Y-%m-%dT%H:%M:00') # start of audit slice, defaulting to 5 minutes ago
FN=$(date -d "yesterday 00:00" '+%Y%m%d%H%M') # timestamp string to append to output filename
END=$(date '+%Y-%m-%dT%H:%M:00') # end of audit slice, defaulting to now, at the top of the minute
TARGET=/var/log/sdm # location where JSON files are written
/opt/strongdm/bin/sdm audit activities --from "$START" --to "$END" -j > "$TARGET/activities.$FN.json"Add Crontab Entry
Last updated
Was this helpful?

