webhooksrundeck

Rundeck webhook for log events


I'm trying to understand a little better how the Rundeck Log Events Webhook works and I wanted to know if it is possible to obtain information similar to that found in the log file /var/log/rundeck/rundeck.executions.log through this Webhook.

[2024-05-31T17:09:00,057] INFO running.status admin start [134664:running] my_project admin/- "-/teste -"[e8d60adasba-c980-471e-b0a1-b307886dase116d]]

[2024-05-31T17:09:12,657] INFO execution.statusadmin finish [134664:success] my_project admin/- "-/test -"[e8d60adasba-c980-471e-b0a1-b307886dase116d]

Because after creating an event log webhook and consuming the api, I only received the request status code as 200 OK

I looked through the runcek documentation, but it doesn't seem very informative.

https://docs.rundeck.com/docs/manual/webhooks.html


Solution

  • This webhook enables you to submit any data, which should be recorded in the rundeck.webhooks.log file. This is useful for debugging. Is useful if you want to find out what data the Rundeck instance receives from your API call.

    You will always receive an answer of 200 if you call it correctly. eg:

    This data:

    curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"name\":\"john\"}" http://localhost:4440/api/47/webhook/hc21abavJGBZG7vsBqZgqDdIX076OUVT#MyWebhook
    

    Stores this register in the rundeck.webhooks.log file:

    [2024-06-03T10:17:58,203] INFO  webhook.events - processing 'MyWebhook' with plugin 'log-webhook-event' triggered by: 'admin'
    [2024-06-03T10:17:58,203] INFO  webhook.events - Log Webhook Event Plugin - Webhook event information:
    [2024-06-03T10:17:58,203] INFO  webhook.events - id: 10a3dddf-efc0-463d-9497-8ccb6345afdb
    [2024-06-03T10:17:58,203] INFO  webhook.events - name: MyWebhook
    [2024-06-03T10:17:58,203] INFO  webhook.events - project: ProjectEXAMPLE
    [2024-06-03T10:17:58,203] INFO  webhook.events - sender: 127.0.0.1
    [2024-06-03T10:17:58,203] INFO  webhook.events - contentType: application/json
    [2024-06-03T10:17:58,203] INFO  webhook.events - data:
    [2024-06-03T10:17:58,204] INFO  webhook.events - {"name":"john"}
    

    You have a specific doc entry here.

    If you want to retrieve exec info, you can use the specific API endpoint.