Splunk Search

sendemail command - naming convention - attachment

Kopcisko
Engager

Hello everyone, 

I would like to ask you for an assistance if possible. Is there a way how to rename an attachment when used a sendemail command within MAP (loop)?

Below simple command sends out two emails, however each attachment matches this naming convention = unknown-YYYY-MM-DD.

############ START OF SAMPLE SEARCH ###############
| makeresults format=csv data="name,age
Robert,18
Filip,22
"
| map maxsearches=2 search="search index=_internal $name$| stats c
| sendemail
to=\"[email protected]\"
subject=\"Splunk report\"
message=\"See attached report.\"
sendresults=true
format=csv"
############### END OF SAMPLE SEARCH ###############

Labels (1)
0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Kopcisko 

Unfortunately you can only set the filename when triggering from a alert action or from a scheduled search.

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...

Splunk Developers: Construct Your Future at the .conf26 Builder Bar

Calling all Splunk architects, platform admins, and app developers: the site is open, and the blueprints are ...

Quick connection discovery mode for forwarders

When a Splunk forwarder loses connectivity to its indexers, it does not always reconnect immediately. In many ...