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=\"robert@destination.com\"
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!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...