Reporting

WHY is sendemail to=$mail$ not working ?

lifekis
Explorer

hello, 

sendemail can not work variable fields.

example,

 

 

index=mail
| table id domain
| eval email=id."@abc.com"
| sendemail to="$email$" subject="test" sendresult=true inline=true message="test"

 

 

>> command="sendemail", {} while sending mail to:

 

 

 

index=_internal email

 

 

>> ERROR sending email. subject="test", results_line="None", recipients="[]", server="localhost"

 

why can't I identify my email address?

it works normally when i enter email address.

 

Labels (1)
Tags (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The way you are using it, $email$ is notation for a token, not a field - have you tried

| sendemail to=email subject="test" sendresult=true inline=true message="test"
0 Karma

lifekis
Explorer

The following information is output:
before: 
ERROR sending email. subject="test", results_line="None", recipients="[]", server="localhost"
after: INFO sending email. subject="test", results_line="None", recipients="[email]", server="localhost"

0 Karma
Get Updates on the Splunk Community!

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...