Hey @sbutto im using your /coldToFrozenPlusS3Uplaod.py
to upload to S3 but getting issues can any one help me
here is the attributes i have added
import sys, os, gzip, shutil, subprocess, random, gnupg
import boto
import datetime
import time
import tarfile
applyLogging is a python script named applyLogging.py that exists at the same level of this script.
If the file applyLogging.py doesn't exist where this file is located, the import statement will fail.
sys.path.append(script_path)
import applyLogging
CHANGE THIS TO YOUR ACTUAL ARCHIVE DIRECTORY!!!
ARCHIVE_DIR = "/splunk/index/splunk/archiveindex"
ARCHIVE_DIR = os.path.join(os.getenv('SPLUNK_HOME'), 'frozenarchive')
script_path = '/opt/splunk/etc/apps/Encrypt-upload-archived-Splunk-buckets-master/coldToFrozenPlusS3Uplaod.py'
log_file_path = '/opt/splunk/var/log/splunk/'
gnu_home_dir = '' #where the gpg directory is. For example /home/s3/.gnupg/
gnu_home_dir = /home/splunkq/.gnupg
reciepient_email = '' #the email the gpg uses to encrypt the files
reciepient_email =
[email protected]
Enabling the logging system
logger = applyLogging.get_module_logger(app_name='SplunkArchive',file_path=log_file_path)
Finding out the epoch value at four month ago so we can copmare the bucket timestamp against it.
First we need to find today's epoch
today=round(time.mktime(datetime.datetime.today().timetuple()))
Substract 120 days
one_month_earlier=today-120*86400
logger.info('Started on '+str(datetime.datetime.today()))
Getting the hostname so we can prefix the uploaded file name with it to distinguish buckets from different indexes.
hostname=os.uname()[1]
S3 creds
AWS_ACCESS_KEY_ID="xxxx"
AWS_ACCESS_KEY_SECRET="xxxx"
AWS_BUCKET_NAME="s3://zfu-splunk-pa/"
Creating the gpg object
gpg = gnupg.GPG(gnupghome=gnu_home_dir)
... View more