Hi Community-
I was hoping it would be simple to set up an arbitrary input (I chose GELF HTTP) to be able to act at the very least as a heartbeat for a service calling in with webhooks (Mailgun API). Mailgun webhooks don’t allow port, so I tossed up an nginx proxy_pass, and that works as far as data flow goes. A demo/example inbound webhook message is:
event-data: {
"tags": [
"my_tag_1",
"my_tag_2"
],
"timestamp": 1521472262.908181,
"storage": {
"url": "https://se.api.mailgun.net/v3/domains/ihtspirit.com/messages/message_key",
"key": "message_key"
},
"envelope": {
"sending-ip": "209.61.154.250",
"sender": "bob@ihtspirit.com",
"transport": "smtp",
"targets": "alice@example.com"
},
"recipient-domain": "example.com",
"id": "CPgfbmQMTCKtHW6uIWtuVe",
"campaigns": [
],
"user-variables": {
"my_var_1": "Mailgun Variable #1",
"my-var-2": "awesome"
},
"flags": {
"is-routed": false,
"is-authenticated": true,
"is-system-test": false,
"is-test-mode": false
},
"log-level": "info",
"message": {
"headers": {
"to": "Alice ",
"message-id": "20130503182626.18666.16540@ihtspirit.com",
"from": "Bob ",
"subject": "Test delivered webhook"
},
"attachments": [
],
"size": 111
},
"recipient": "alice@example.com",
"event": "delivered",
"delivery-status": {
"tls": true,
"mx-host": "smtp-in.example.com",
"attempt-no": 1,
"description": "",
"session-seconds": 0.4331989288330078,
"utf8": true,
"code": 250,
"message": "OK",
"certificate-verified": true
}
}
I can curl the endpoint with a specifically crafted Graylog message:
curl -XPOST https://mydomain/mailgun_logger/ -p0 -d '{"short_message":"Hello there with trailing slash in url", "host":"example.org", "facility":"test", "_foo":"bar"}'
, but the Mailgun messages (while they do show in nginx access log) are not showing in Graylog. What’s the better approach?
Thanks!
-Bronius