Deployment Architecture

Splunk Backup of indexed data on S3 buckets

deepashri_123
Motivator

Hi Splunkers,

I have a clustered environment in aws infrastructure. I need to backup my data on daily basis to ensure high availability of data.
I have created a backup app on indexers which schedules a script to run on daily basis which takes backup of my buckets in splunk and copy it on my S3 bucket in aws.
How to ensure the backup of data taken has no duplicate buckets?

Currently I am using this script.

#Roll hotbucket
for i in `ls /opt/splunk/var/lib/splunk -I “*.dat” -I “_*”` ; do /opt/splunk/bin/splunk _internal call /data/indexes/$i/roll-hot-buckets -auth admin:password ; done

# incremental backup:
for i in `ls /opt/splunk/var/lib/splunk -I "*.dat" -I "_*" -I "authDb" -I "persistent*" -I "hashDb" -I "kvstore"` ; do for j in `ls /opt/splunk/var/lib/splunk/$i/db | grep db_` ; do aws s3 sync /opt/splunk/var/lib/splunk/$i/db/$j s3://splunk-databackup/$i/$j >> /opt/splunk/etc/apps/backup/logs/backup_output.log ; done ; done
for i in `ls /opt/splunk/var/lib/splunk -I "*.dat" -I "_*" -I "authDb" -I "persistent*" -I "hashDb" -I "kvstore"` ; do for j in `ls /opt/splunk/var/lib/splunk/$i/colddb | grep db_` ; do aws s3 sync /opt/splunk/var/lib/splunk/$i/colddb/$j s3://splunk-databackup/$i/$j >> /opt/splunk/etc/apps/backup/logs/backup_output.log ; done ; done

How do I ensure that there is no data duplication when the backup runs each time?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...