-
Notifications
You must be signed in to change notification settings - Fork 288
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
Add new alerter for a more flexible HTTP Post #530
Add new alerter for a more flexible HTTP Post #530
Conversation
I don't seem to fix loaders.py |
How to write changelog is different from other people. Please correct. |
Does this really work? |
It looks like HTTPPost2Alerter isn't called from anywhere. If you specify alert: post, it will be called HTTP Post Alerter as it is. |
If you want to keep the HTTPPostAlerter, you may use the old one and the new one at the same time. If so, shouldn't the setting name be http_post2_ setting name at the beginning so that it doesn't collide? |
As I said, it
Yeah, my bad. I'm not really familiar with this code, so I forgot to add the
Yes totally, thanks for pointing it out! I'm fixing this in a new commit |
ffeb1af
to
59d71c6
Compare
I think you should add the validation check setting to schema.yaml. There is a description of HTTP POST settings in 440 to 445. When you run the rule, jsonschema can check the settings in schema.yaml and check the data type if there is a key, and if they are different, you can raise an exception to prevent the rule from running. |
Is there anything else you care about? |
Description
Add a new alerter
HTTP Post 2
which is a more flexible version of theHTTP Post
alerter.This alerter remove the difference between
http_post_payload
andhttp_post_payload_static
to privileged only one fieldhttp_post_payload
which allow to use Jinja2 templating to inject fields in a HTTP Post body.I kept the old behavior of
http_post_payload
inhttp_post_raw_fields
in case you want to keep the type of a field (a number for example).The Jinja templating works for the keys and also the values, providing total flexibility for the users to send HTTP request with any format using the fields of the matches.
This PR resolve (at least partially):
Checklist
make test-docker
with my changes.Questions or Comments
HTTP Post
and doesn't require a major version change.