Yuan,

If you add a static key=value pair, you need to add it using the "fields="
section.  However, when the "fields=" section is used, you must list all of
the fields that you want to appear in the POST data.

Here is an example that sends message_type and the message itself:

fields=message_type=CRITICAL
   message={message}


Try placing this at the end of your posturl.conf where you currently only
have "message_type=CRITICAL"

Thank you,

Ryan Springer
Opscenter Provisioning Team

On Tue, Jul 19, 2016 at 6:56 PM, Yuan Fang <y...@kryptoncloud.com> wrote:

> Anyone succeeded?
>
>
>
> Here is my setting for postUrl.
> ==================================
> ubuntu@ip-172-31-55-130:/etc/opscenter/event-plugins$ more posturl.conf
>
> [posturl]
> enabled=1
>
> # levels can be comma delimited list of any of the following:
> # DEBUG,INFO,WARN,ERROR,CRITICAL,ALERT
> # If left empty, will listen for all levels
> levels=
>
> # clusters is a comma delimited list of cluster names for which
> # this alert config will be eligible to run.
> # If left empty, this alert will will be called for events on all clusters
> clusters=
>
> # the URL to send a HTTP POST to
> url=https://alert.victorops.com/integrations/generic*********
>
> # Set a username for basic HTTP authorization
> #username=foo
>
> # Set a password for basic HTTP authorization
> #password=bar
>
> # Set the type of posted data. Available options are 'json' or 'form'
> post_type=json
>
> # Fields specified here will override the default event data fields.
> #
> # They must be formatted as key-value pair, with key and value separated by
> # an equals (=). Each pair after the first must be on its own line,
> # indented beyond the first line
> #
> # You may use tokens found within the default event data for or in
> # values. For example, some available keys are:
> #   cluster, time, level_str, message, target_node, event_source, success,
> api_source_ip, user, source_node
> # Keys must be encapsulated in {brackets}.
> #
> #fields=textKey=value
> #    mixedKey=cluster-{cluster}
> #    event-msg={message}
> message_type=CRITICAL
>

Reply via email to