alert_text doesn't work when sending alert to a POST server
Hello. I've this rule:
name: MyRule
type: any
index: logstash-*
filter: []
alert:
- post
http_post_url: "http://ptsv2.com/t/lalala/post"
alert_text: "Timestamp: {0} ; Message: {1}"
alert_text_type: alert_text_only
alert_text_args: ["@timestamp","message"]
Alerts are received by post server correctly (in fact, this server is public, so you can see the content of the received message if you go to http://ptsv2.com/t/lalala) BUT alert_text+alert_text_type+alert_text_args options are completely ignored: received message on server is a JSON which, moreover, I can't relate to theorical default alert's body explained here https://elastalert.readthedocs.io/en/latest/ruletypes.html#alert-content
Do you know why? Am I doing something wrong? Is it a bug?
Thanks!!!
This is a bug (or feature 😉 ). You can't add it easily right now, but this is definitely something I want to fix.
There's some workarounds you could do. One is to create an enhancement that would create this string so you can put it into the http_post_payload. This would require writing a small amount of Python code though. If you want some help on that let me know.
Ok, Thanks for caring about it. I'll be waiting, it's not an urgent issue for me. Thanks
I had the same problem,and i want to know when to fix it, thanks~~ @Qmando
This is a bug (or feature 😉 ). You can't add it easily right now, but this is definitely something I want to fix.
There's some workarounds you could do. One is to create an enhancement that would create this string so you can put it into the http_post_payload. This would require writing a small amount of Python code though. If you want some help on that let me know.
Hi @Qmando Do we have this feature now! in http post alerts. I have created an HTML template into the alert_text, which i want to pass into http_post_payload. Is there a way?