Customer asked for test data prior to roll off.
Steps
038e00d047
subnet-035fc7b980
xdr-indexer-instance-role
ma-c19-splunk-test-standalone
msoc-buildinstall a modern version of the aws cli.
/usr/local/bin/aws --version
set it to the customer via aws s3 presign url
/usr/local/bin/aws s3 cp azure_bucket.tar.gz s3://xdr-ma-c19-prod-splunk-frozen
/usr/local/bin/aws s3 presign s3://xdr-ma-c19-prod-splunk-frozen/azure_bucket.tar.gz --expires-in 604800
Customer is OK with Splunk .tsidx files. No need to convert them to text files. Customer does need smaller file sizes. Index tar.gz files will need to be broken up.
How big and old are the indexes?
| rest /services/data/indexes/
| search title=* NOT title=_* NOT title=junk
| eval indexSizeGB = if(currentDBSizeMB >= 1 AND totalEventCount >=1, currentDBSizeMB/1024, null())
| eval elapsedTime = now() - strptime(minTime,"%Y-%m-%dT%H:%M:%S%z")
| eval dataAge = ceiling(elapsedTime / 86400)
| stats sum(indexSizeGB) AS totalSize max(dataAge) as oldestDataAge by title
| eval totalSize = if(isnotnull(totalSize), round(totalSize, 2), 0)
| eval oldestDataAge = if(isNum(oldestDataAge), oldestDataAge, "N/A")
| rename title as "Index" totalSize as "Total Size (GB)" oldestDataAge as "Oldest Data Age (days)"
What is the current license usage? Is data is coming in?
index=_internal host=ma-c19-splunk-cm* source="/opt/splunk/var/log/splunk/license_usage.log*" type=Usage
| eval mb = round(b/1024/1024,2)
| timechart span=1d useother=f sum(mb) AS gbytes BY h
/opt/splunkdata/hot/normal_primary
Uncompressed Compressed
(5 parts uploaded)app_aws 368GB 246G
(3 parts uploaded)salesforce 185GB 112GB
(4 parts uploaded)junk 223GB 163G
(done)azure 47GB 36GB
(done)app_o365 4.8GB 3.3GB
(done)defaultdb 12MB 7.1MB
(done)audit 30GB 21GB
total: 635GB
total Compressed: 581 GB
Progress Bar: 12/12
total progress bar: 16/16
File sizes du -sh * | sort -h
Ensure the aws cli is installed. If not, use a python venv to setup aws cli. This assumes python3 is already installed. Why not use awscliv2? Because it is not in pip! These instructions need to be updated to use awscliv2.
cd ~
python3 -m venv awscli
source awscli/bin/activate
cd awscli/bin
pip install awscli
chmod +x aws
aws --version
#bash oneliner
cd ~ && python3 -m venv awscli && source awscli/bin/activate && cd awscli/bin && pip install awscli && chmod +x aws && aws --version
The aws cli should be able to use the IAM instance role to connect to S3. No need to add AWS keys but you will need to configure the region (us-gov-east-1).
aws configure
aws s3 ls
Actually upload the file with this command:
~/awscli/bin/aws s3 cp /opt/splunkdata/hot/normal_primary/app_o365_index.tar.gz s3://xdr-ma-c19-prod-splunk-frozen/app_o365_index.tar.gz
Run this some where you have awscliv2 ( sorry super annoying i know! If you don't use awscliv2 you will not be able to download the file. )
aws --profile=mdr-prod-ma-c19-gov s3 presign s3://xdr-ma-c19-prod-splunk-frozen/app_o365_index.tar.gz --expires-in 86400
split -b 50G salesforce_index.tar.gz salesforce_index.tar.gz.part-