You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had some issues with our implementation of the slack handler with the payload_template option configured. Our template looked like this, very similar to the example in the README : { "attachments": [ { "fallback": "<%= @event["check"]["output"] %>", "color": "<%= color %>", "title": "<%= @event["check"]["name"] %> (<%= @event["client"]["name"] %>)", "text": "<%= @event["check"]["output"].gsub('"', '\\"') %>" } ] }
What we found was that with the above template we were losing messages containing escaped double quotes in the output. Eg.
from the CheckPostgresAlive in sensu-plugins-postgres: "output":"CheckPostgres CRITICAL: Error message: FATAL: database \"mon-test\" does not exist\n"
We were able to correct this(i.e. slack alerts now being recieved and displaying as expected) by changing the gsub to read : gsub('"', '\"')
^^^ note one less backslash.
Can you update the readme if I have correctly interpreted this.
The text was updated successfully, but these errors were encountered:
We had some issues with our implementation of the slack handler with the payload_template option configured. Our template looked like this, very similar to the example in the README :
{ "attachments": [ { "fallback": "<%= @event["check"]["output"] %>", "color": "<%= color %>", "title": "<%= @event["check"]["name"] %> (<%= @event["client"]["name"] %>)", "text": "<%= @event["check"]["output"].gsub('"', '\\"') %>" } ] }
What we found was that with the above template we were losing messages containing escaped double quotes in the output. Eg.
from the CheckPostgresAlive in sensu-plugins-postgres:
"output":"CheckPostgres CRITICAL: Error message: FATAL: database \"mon-test\" does not exist\n"
We were able to correct this(i.e. slack alerts now being recieved and displaying as expected) by changing the gsub to read :
gsub('"', '\"')
^^^ note one less backslash.
Can you update the readme if I have correctly interpreted this.
The text was updated successfully, but these errors were encountered: