Webhook: Parsing data from parse-parameters-as-json

Created on 25 Jun 2017  路  1Comment  路  Source: adnanh/webhook

Hello.

I'm trying to configure parsing of downtime webhooks from newrelic. It comes with application/x-www-form-urlencoded request with content alert%3D%7B%22created_at%22%3A%222017-06-25T19%3A51%3A57Z%22%2C%22alert_policy_name%22%3A%22Default%20application%20alert%20policy%22%2C%22application_name%22%3A%22test%22%2C%22account_name%22%3A%22test%22%2C%22severity%22%3A%22downtime%22%2C%22message%22%3A%22unable%20to%20ping%20test.com%22%2C%22short_description%22%3A%22New%20alert%20for%20Default%20application%20alert%20policy%3A%20unable%20to%20ping%20test.com%22%2C%22long_description%22%3A%22Alert%20opened%20for%20Default%20application%20alert%20policy%20--%20Triggered%20by%3A%20unable%20to%20ping%20test.com%20--%20Apps%20currently%20involved%3A%20guru%22%2C%22alert_url%22%3A%22https%3A%2F%2Frpm.newrelic.com%2Faccounts%2Fxxxx%2Fincidents%2Fxxxxx%22%7D. E.g. JSON object contains in field alert not in just resuest's body.

I can not find the correct way to set parse-parameters-as-json in order for the processing to be successful. Could you suggest the correct way?

question

Most helpful comment

Hey, here's a sample usage to extract the message and pass it down the command:

[
  {
    "id": "example",
    "parse-parameters-as-json": [
      {
        "source": "payload",
        "name": "alert"
      }
    ],
    "execute-command": "echo",
    "pass-arguments-to-command": [
      {
        "source": "payload",
        "name": "alert.message"
      }
    ]
  }
]

>All comments

Hey, here's a sample usage to extract the message and pass it down the command:

[
  {
    "id": "example",
    "parse-parameters-as-json": [
      {
        "source": "payload",
        "name": "alert"
      }
    ],
    "execute-command": "echo",
    "pass-arguments-to-command": [
      {
        "source": "payload",
        "name": "alert.message"
      }
    ]
  }
]
Was this page helpful?
0 / 5 - 0 ratings