Alerting

how to forward a msg to email/slack trigger alert

danan
Observer

Hello, 

 

I'm trying to add msg value to slack and email trigger alert but I'm getting the first word of msg field. 

I would like to get the full message. 

here's the search results: 

danan_1-1593947051179.png

here's the slack trigger: I used $results.msg$ 

danan_2-1593947120233.png

this is what I get: 

danan_3-1593947200521.png

 

now, I want to get the full message. 

instead of "Test", I want to forward the full message from msg field: "Test message generated successfully" 

could you please assist? 

Thanks,

 

 
Labels (1)
Tags (2)
0 Karma

renjith_nair
SplunkTrust
SplunkTrust

@danan,

It doesn't seem to take the msg field but the literal "msg" from your token.

Use $result.msg$ instead of $results.msg$

Please be reminded that the filed values are limited to first value for the specified field name from the first search result row. Also make sure that the field is available(fields a,b,c,) in the result set especially if its an extracted field

Happy Splunking!
0 Karma

danan
Observer

@renjith_nair ,  I've changed to $result.msg$ but still, it presents only the first word.

maybe there are other ways to get the full message instead of the first word? 

 

Thanks, 

Dan

 

 

 

0 Karma

renjith_nair
SplunkTrust
SplunkTrust

@danan, in your screen shot (between host and sourcetype), it extracts "Test" as a value in msg. You shall try adding quotes around the message to treat them as a single field , e.g. "Test message generated ....".

Happy Splunking!
0 Karma

danan
Observer

@renjith_nair , Thanks! how do i do this? 

0 Karma

renjith_nair
SplunkTrust
SplunkTrust

It's easy if you could change in the data inputs/ingest time. Just add quotes around the value before its pushed to Splunk.

For those events which are already available in Splunk, you may extract it from _raw

e.g.

|rex "msg=(?<message>.+)"

 

Happy Splunking!
0 Karma
Get Updates on the Splunk Community!

Platform Highlights | November 2022 Newsletter

 November 2022 Skill Up on Splunk with our New Builder Tech Talk SeriesCan you build it? Yes you can! *play ...

Splunk Education - Fast Start Program!

Welcome to Splunk Education! Splunk training programs are designed to enable you to get started quickly and ...

Five Subtly Different Ways of Adding Manual Instrumentation in Java

You can find the code of this example on GitHub here. Please feel free to star the repository to keep in ...