Restart graylog collector


(Matt) #1

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.


(Marco Pfatschbacher) #2

Take a look at the API browser:
http://127.0.0.1:9000/api/api-browser/#!/Plugins/System/Collectors/setAction_put_4

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

 [
  { 
    "backend":"filebeat",
    "properties":
      {"restart":true}
  }
]

(Marco Pfatschbacher) #3

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}}]’


(Matt) #4

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.


(system) #5

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