sendemail
sendemail
Synopsis
Emails search results to specified email addresses.
Syntax
sendemail to=<email_list> [from=<email_list>] [cc=<email_list>] [bcc=<email_list>] [format= (html|raw|text|csv)] [inline= (true|false)] [sendresults=(true|false)] [priority= (highest|high|low|lowest)] [server=string] [width_sort_columns=<bool>] [graceful=bool]
Required arguments
- to
- Syntax: to=<email_list>
- Description: List of email addresses to send search results to.
Optional arguments
- bcc
- Syntax: bcc=<email_list>
- Description: Blind cc line; comma-separated and quoted list of valid email addresses.
- cc
- Syntax: cc=<email_list>
- Description: Cc line; comma-separated quoted list of valid email addresses.
- format
- Syntax: format= csv | html | raw |text
- Description: Specifies how to format the email's contents. Defaults to HTML.
- from
- Syntax: from=<email_list>
- Description: Email address from line. Defaults to "splunk@<hostname>".
- inline
- Syntax: inline= true | false
- Description: Specifies whether to send the results in the message body or as an attachment. Defaults to true.
- graceful
- Syntax: graceful= true | false
- Description: If set to true, no error is thrown, if email sending fails and thus the search pipeline continues execution as if sendemail was not there.
- priority
- Syntax: priority=highest | high | low | lowest
- Description: Set the priority of the email as it appears in the email client. Lowest or 5, low or 4, high or 2, highest or 1; defaults to normal or 3.
- sendpdf
- Syntax: sendpdf=true | false
- Description: Specify whether to send as pdf or not.
- sendresults
- Syntax: sendresults=true | false
- Description: Determines whether the results should be included with the email. Defaults to false.
- server
- Syntax: server=<string>
- Description: The SMTP server, default is localhost.
- subject
- Syntax: subject=<string>
- Description: Specifies the subject line. Defaults to "Splunk Results".
- width_sort_columns
- Syntax: width_sort_columns=<bool>
- Description: This is only valid when
format=text. Specifies whether the columns should be sorted by their width.
Examples
Example 1: Send search results in HTML format with the subject "myresults".
... | sendemail to="elvis@splunk.com,john@splunk.com" format=html subject=myresults server=mail.splunk.comExample 2: Send search results to the specified email.
... | sendemail to="elvis@splunk.com"Answers
Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has using the sendemail command.
This documentation applies to the following versions of Splunk: 4.1 , 4.1.1 , 4.1.2 , 4.1.3 , 4.1.4 , 4.1.5 , 4.1.6 , 4.1.7 , 4.1.8 , 4.2 , 4.2.1 , 4.2.2 , 4.2.3 , 4.2.4 , 4.2.5 , 4.3 , 4.3.1 , 4.3.2 View the Article History for its revisions.