Alerting

How to create alert based on index name to different email address?

splunking4me
Explorer

Hello,

we are ingesting data on multiple indexes for different departments. we want to create an alert when any index is not receiving logs from host should send and email to specific department mail address.  we created a lookup .csv file and mention indexname and email address. below is the query which i am trying to execute but no results.

splunking4me_0-1665478252459.png

 

| tstats latest(_time) as latest where index=* earliest=-6h by host
| eval recent = if(latest > relative_time(now(),"-45m"),1,0), realLatest = strftime(latest,"%c")
| where recent=0
| outputlookup weblogs-index.csv
| stats values(useremail) AS emailToHeader | mvexpand emailToHeader
| map search="index | inputlookup weblogs-index.csv | where useremail=\"$emailToHeader$\"
| fields - useremail
| 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\$\""
| appendpipe [|inputlookup weblogs-index.csv]

Labels (3)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...