Alerting

How can I get the message alert in mail showing only the failed job example instead of the complete log?

kc_prane
Communicator

How Can i just get the message alert in mail showing only the  failed job example "Job=[ADM-FILENET-DLY]] " instead of the complete log.   Note: The Job names are dynamic 

 

My Current Alert Query :

index=*  host=*MYhost*    "*IN-RCMCO-DLY*"  OR  "*ADJ-RECERT-DLY*"  OR  *AD*-*Y*"   FAILED job_status2=FAILED OR status=FAILED OR status1=FAILED OR ExitCode=FAILED | rex field=_raw ".*status:\s\[(?P<status1>\S+)\]" | rex field=_raw "JOB\s(?P<job_status2>\w+)" |rex field=_raw "(exitCode=)(?<ExitCode>\w+)"
| eval _raw=substr(_raw, 1, 1500)
| table _time job_status2 status1 status ExitCode _raw

 

log 

22-08-28 18:01:31,323 INFO [main] c.l.b.listener.JobCompletionListener: :::::::::::::::BATCH JOB FAILED:::::::::::JobExecution: id=21099, version=1, startTime=Sun Aug 28 18:01:29 CDT 2022, endTime=Sun Aug 28 18:01:31 CDT 2022, lastUpdated=Sun Aug 28 18:01:29 CDT 2022, status=FAILED, exitStatus=exitCode=FAILED;exitDescription=com.ltss.fw.exception.ApplicationException: Error occured while processing appDocument: In catch block, exception stackTrace,job=[JobInstance: id=21099, version=0, Job=[ADM-FILENET-DLY]], jobParameters=[{chunkSize=null, skipLimit=null, commitInterval=null, time=1661727689449, asOfDate=1661662800000}]

Labels (1)
Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The alert mechanism cannot edit your results for you.  You must modify the search to return only the results you want in the message.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

kc_prane
Communicator

Hi @richgalloway, thanks for the response. Iam looking for search results in the mail but not the complete search results  but want only the  failed job name : "Job=[ADM-FILENET-DLY]]"

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The alert mechanism cannot edit your results for you.  You must modify the search to return only the results you want in the message.

---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

Edit the alert and deselect the box the "Inline" box to prevent Splunk from putting the search results in the alert message.  By default, the alert name is part of the subject field, as shown below

richgalloway_0-1661793075391.png

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...