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

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
Get Updates on the Splunk Community!

Simplifying the Analyst Experience with Finding-based Detections

    Splunk invites you to an engaging Tech Talk focused on streamlining security operations with ...

[Puzzles] Solve, Learn, Repeat: Word Search

This challenge was first posted on Slack #puzzles channelThis puzzle is based on a letter grid containing ...

[Puzzles] Solve, Learn, Repeat: Advent of Code - Day 4

Advent of CodeIn order to participate in these challenges, you will need to register with the Advent of Code ...