Other Usage

send an alert to appropriate responsible person

iswiau
Engager

Hello Friends,

My search returns the following:

serverName errorNumber responsiblePerson responsblePersonEmail
server_a4586Bob M.bobm@tmail.com
server_a1236Bob M.bobm@tmail.com
server_a788Bob M.bobm@tmail.com
server_b468Bob M.bobm@tmail.com
server_b8798Bob M.bobm@tmail.com
server_c5647Amelia S.amelias@tmail.com
server_c556Amelia S.amelias@tmail.com
server_c789Amelia S.amelias@tmail.com
server_c8799Amelia S.amelias@tmail.com

 

I want to send alerts by email to appropriate responsible person.

Each responsible person should receive ONLY ONE email that contain ALL errors on the servers for which he is responsible.

In this example Bob should receive one email that contain 5 lines (3 for server_a and 2 for server_b), and Amelia should receive one email that contain 4 lines (for server_c).

Any help would be appreciated!

 

 

Labels (3)
0 Karma
1 Solution

iswiau
Engager

Thank you for the quick answers.

The task assigned to me has changed
The customer wants to receive a separate email for each server.
This made solving the problem very simple  🙂

 

| stats values(*) as * by serverName

 

and than set the alert to trigger for each result.

Thank you very much!

View solution in original post

0 Karma

iswiau
Engager

Thank you for the quick answers.

The task assigned to me has changed
The customer wants to receive a separate email for each server.
This made solving the problem very simple  🙂

 

| stats values(*) as * by serverName

 

and than set the alert to trigger for each result.

Thank you very much!

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Use stats values() or stats list() to group events by recipient. Then use sendresults - https://splunkbase.splunk.com/app/1794

 

inventsekar
SplunkTrust
SplunkTrust

Hi @iswiau .. May we know, do you have only a small list of id's.. or a big list of people?

if you have only a small list of ids... you can use a if condition and select the email id. 

or, you can create a notepad file with the email ids and use map command like this..

... | outputcsv TempFile.csv
| stats values(Email_Address) AS emailToHeader | mvexpand emailToHeader
| map search ="|inputcsv TempFile.csv | where Email_Addresss=\"$emailToHeader$\"
   | fields - Email_Address
   | sendemail
      sendresults=true inline=true
      server=\"Your.Value.Here\"
      from=\"Your.Value.Here\"
      to=\"$emailToHeader$\"
      subject=\"Your Subject here: \$name\$\"
      message=\"This report alert was generated by \$app\$ Splunk with this search string: \$search\$\""
| where comment="MakeSureNoEventsRemail"
| append [|inputcsv TempFile.csv]

this above one is from this page

Get Updates on the Splunk Community!

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 ...

Cloud Platform & Enterprise: Classic Dashboard Export Feature Deprecation

As of Splunk Cloud Platform 9.3.2408 and Splunk Enterprise 9.4, classic dashboard export features are now ...