<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Splunk 7.2 Update sendemail for custom csv attachment names in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468466#M7532</link>
    <description>&lt;P&gt;I was able to name the attachment using the instructions I listed above.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2019 18:48:27 GMT</pubDate>
    <dc:creator>jnsd03</dc:creator>
    <dc:date>2019-09-03T18:48:27Z</dc:date>
    <item>
      <title>Splunk 7.2 Update sendemail for custom csv attachment names</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468463#M7529</link>
      <description>&lt;P&gt;I would like to be able to customize the name of the csv attachments sent using the sendemail function. Is there any other way to do this besides editing the sendemaily.py script?  &lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 14:04:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468463#M7529</guid>
      <dc:creator>jnsd03</dc:creator>
      <dc:date>2019-08-28T14:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2 Update sendemail for custom csv attachment names</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468464#M7530</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.1/SearchReference/Sendemail"&gt;sendmail&lt;/A&gt; documentation doesn't have any options to modify file name of attachment. Be default, the attachment name is the report name (with timestamp as suffix) that generates the alert . &lt;/P&gt;

&lt;P&gt;To modify the file name of attachment,&lt;BR /&gt;
1. Either change the report name&lt;BR /&gt;
2. Or modify the sendmail.py script&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# sendmail.py | Line 1179, 1180
filename = pu.makeReportName(pattern=fileName, type="csv", reportProps=props)
csvAttachment.add_header('Content-Disposition', 'attachment', filename=filename)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Aug 2019 04:17:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468464#M7530</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-08-29T04:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2 Update sendemail for custom csv attachment names</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468465#M7531</link>
      <description>&lt;P&gt;I was able to do this after following the instruction in  &lt;A href="https://answers.splunk.com/answers/612925/how-to-set-attachment-name-in-sendemail-command.html"&gt;https://answers.splunk.com/answers/612925/how-to-set-attachment-name-in-sendemail-command.html&lt;/A&gt; but I also had to add this to line 525 of my custome sendmail.py script to allow the attachment to also be passed a custome field name:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if ssContent.get('action.email.reportFileName'):
    stringsForPost['action.email.reportFileName'] = ssContent['action.email.reportFileName']
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Aug 2019 14:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468465#M7531</guid>
      <dc:creator>jnsd03</dc:creator>
      <dc:date>2019-08-29T14:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2 Update sendemail for custom csv attachment names</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468466#M7532</link>
      <description>&lt;P&gt;I was able to name the attachment using the instructions I listed above.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 18:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468466#M7532</guid>
      <dc:creator>jnsd03</dc:creator>
      <dc:date>2019-09-03T18:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2 Update sendemail for custom csv attachment names</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468467#M7533</link>
      <description>&lt;P&gt;Glad you figured it out. Mark the answer as accepted and close the thread.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 23:54:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468467#M7533</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-09-03T23:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2 Update sendemail for custom csv attachment names</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468468#M7534</link>
      <description>&lt;P&gt;I would like to format today's date and use it in the subject and attachment_name but I haven't found a good solution for that.  I am able to use the $job.latestTime$ in the subject but I can't format it and it's not being read by in the attachment_name.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468468#M7534</guid>
      <dc:creator>jnsd03</dc:creator>
      <dc:date>2020-09-30T02:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2 Update sendemail for custom csv attachment names</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468469#M7535</link>
      <description>&lt;P&gt;You can use &lt;CODE&gt;$result.fieldname$&lt;/CODE&gt; token for custom field value in the email.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval today=strftime(now(),"%d-%m-%Y")
| table
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For this sample query, use &lt;CODE&gt;$result.today$&lt;/CODE&gt; in your email subject to get today's date.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 01:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468469#M7535</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-09-05T01:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2 Update sendemail for custom csv attachment names</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468470#M7536</link>
      <description>&lt;P&gt;@jnsd03 &lt;BR /&gt;
Ideally, you should click Accept to close this question and if you have different query (even if related), ask another question.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 01:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-7-2-Update-sendemail-for-custom-csv-attachment-names/m-p/468470#M7536</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-09-05T01:12:18Z</dc:date>
    </item>
  </channel>
</rss>

