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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...