Getting Data In

How Do you generate CSV File on Schedule basis (eg: Say at 6:00 AM) automatically to a file location

apandura
New Member
 
Tags (2)
0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee

First, Schedule your report and end it with the ouputcsv command

sourcetype=foo | stats count by bar | outputcsv foobar.csv

Choose what time the report runs enable actions 'Run a Script'.

Write a script like this that moves them to the location of your choice

#!/bin/bash
NOW=$(date +"%m-%d-%Y")
OUTFILE="data.$NOW.csv"
mv $SPLUNK_HOME/var/run/splunk/foobar.csv /my/favorite/csv/hideway/OUTFILE

Upload the script to $SPLUNK_HOME/bin/scripts/
Specify the script in the scheduling options.

Relevant step-by-step documentation here

apandura
New Member

Our splunk installation is Managed services on AWS server. How can I get access to "$SPLUNK_HOME/bin/scripts/" directory? So I can get Script in that folder.

Thanks
AP

0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee

Managed by some external party ? Talk to your administrator for SSH access:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html

Otherwise it would be a security vulnerability, right ?

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...