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!

Event Series: Telemetry Pipeline Management

Balancing Scale and Spend: Gaining Control Over High-Volume Metrics in Splunk Observability Cloud As ...

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...

Deep insights, no barriers: Splunk Observability Cloud Free Edition

As software delivery cycles continue to accelerate, observability shouldn’t be a luxury — it should be a ...