Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alert_text doesn't work when sending alert to a POST server #2083

Open
q2dg opened this issue Jan 19, 2019 · 4 comments
Open

alert_text doesn't work when sending alert to a POST server #2083

q2dg opened this issue Jan 19, 2019 · 4 comments

Comments

@q2dg
Copy link

q2dg commented Jan 19, 2019

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!!!

@Qmando
Copy link
Member

Qmando commented Jan 23, 2019

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.

@q2dg
Copy link
Author

q2dg commented Jan 23, 2019

Ok, Thanks for caring about it.
I'll be waiting, it's not an urgent issue for me.
Thanks

@test98123456
Copy link

test98123456 commented Apr 25, 2019

I had the same problem,and i want to know when to fix it, thanks~~ @Qmando

@rashmichoudhary07
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants