Help with watch.poll_file

I'm looking to make use of this feature by basically having a json file which contains all the details of the monitors I want to use and be able to change those on the fly but I'm not entirely sure how to set it up as the docs provide an example that hasn't really helped me figure it out.

here is a basic example of what I want to do:

heartbeat.monitors:
- type: http
  schedule: '@every 15s'
  urls: ["http://google.com"]

- type: http
  schedule: '@every 15s'
  urls: ["http://youtube.com"]

  etc...

except I want to specify the monitors inside the dynamic.json file instead of writing them into the heartbeat.yml file. What exactly should the dynamic.json file contain to achieve this and how should I reference it from the heartbeat.yml file? Any help identifying what I'm missing would be greatly appreciated.

Note: this feature was experimental, even before we have had any kind of reloading in the other beats. This feature will be changed in the future to resemble the other beats.

The poll file setting is part of a monitor. That is, you set "defaults" in the monitor and then you have a file with json object overwriting/adding settings.

like:

heartbeat.monitors:
- type: http
  schedule: '@every 15s'
  watch.poll_file: urls.json

with urls.json:

{"urls": ["http://google.com"]}
{"urls": ["http://youtube.com"]}
{"urls": ["https://myservice"], "ssl": { "certificate_authority": "..." }, "username": "user", "password": "pass1"}

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