Restart graylog collector

This should be a quick one. Is it possible via API to restart the backends? Looks like I can view current registrations and their status via API. That seems to be working fine. Just not seeing an API option that is obvious to me anyway that is able to use the restart option like there is in the collector status interface in the webgui for restarting backends. Looking to automate the process of watching the status of the collector backends and restart failed ones when needed.

Take a look at the API browser:!/Plugins/System/Collectors/setAction_put_4

collectorId: “The uniqe id of your collector”
example JSON:


Or alternatively with curl:

curl ‘http://admin:admin@localhost:9000/api/plugins/org.graylog.plugins.collector/collectors/cbb04ecf-ced3-47a5-9573-4f83b2dce963/action’ -X PUT -H ‘Accept: application/json’ -H ‘Content-Type: application/json’ --data ‘[{“backend”:“filebeat”,“properties”:{“restart”:true}}]’

Thank you Marco. That is exactly what I was looking for. Just wasn’t seeing it in the API browser. Evidently I am blind LOL.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.