There's another way that I'm using these days: Use the sendemail command to send the files as csv and add it to a search; then schedule the search to run at specific time.
For example:
"search pattern1" | ..... | table col1,col2... | sendemail to= format=html subject="Your subject" server=testgateway.sample.com sendresults=true inline=false graceful=true
Two things used here: the table command to tabularize the search results, and the sendemail command.
You can replace the above sample values with your own values. The key options used in this command are: 'inline=false' and 'graceful=true'.
If we choose 'inline=false', it automatically will append the results in .csv format (the file will be named splunk-results.csv so you can save it as per your need.
'graceful=true' this means that Splunk will exit gracefully in case it faces any issue while trying to send the mail.
For more info on table and sendemail, refer to Splunk help section; it has great examples which you can use.
Hope that helps.
Regards,
Mohit Vohra
... View more