Splunk Dev

Playbook: How do I turn string into a CSV email attachment?

dulguun
Engager

I've got a string that contains CSV contents. How do I send an email that has an attachment which is made from my string variable?

Labels (1)
0 Karma

marnall
Motivator

If I understand correctly, you would like your string to be converted into a .csv file, and attached to an email sent by SOAR?

This would likely be a multi-step procedure:

1. Use a custom function to write the CSV to a temporary file on disk.

2. Use a custom function to call phantom.vault_add() to convert the temporary file on disk into a CSV in the vault.

3. Pass the ID of the file in the vault to the email action block as the attachment input.


I personally have never gotten the SMTP app to successfully send file attachments, so I would recommend testing sending email with a file already in a vault before starting steps 1 and 2.

dulguun
Engager

Thank you. It worked.

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...