Splunk Search

How to pass the search results to an email body by using sendresults

lucas4394
Path Finder

I am using "sendresults" command and pass the search results to an email body template; however, the search results didn't show up from the body.  Unfortunately, the Splunk sendresults page doesn't have an example for passing the result to the email body.  I wonder if it is possible to pass search results to the email body.  Does anyone know?  

This is the sample code I used.

 

 

| makeresults
| eval score=90, email_to="john.doe@xyz.com", name="john"
| append [|makeresults | eval score=76, email_to="jane.doe@abc.com",name="jane"]
| fields - _time
| sendresults showresults=f subject="Your Score" body="Hi $result.name$", your score is $result.score$."

 

 

 

Labels (1)
Tags (1)
0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...