I have a need to generate dynamic content in the request body of http-based heartbeat requests.
I need to generate a unique UUID for each call and also a timstamp based on current time in ISO 8601 format.
Any ideas on how to accomplish this?
In short, as of right now, you can't.
This is not supported by heartbeat but you can open a feature request on github and document your use case.
You could fork heartbeat if you have access to a GO developer or add the feature yourself.
You could also use metricbeat and its http module, either the json metricset or the server metricset. In that case you would write an external program or script and this external process would either push the result into the metricbeat http server metricset OR be polled by metricbeat http json metricset poller.
The external program could be either a script that runs like a cronjob or a systemd timer and once done pushed a json event into metricbeat http server. (The event goes to ES...)
The external program could be a python flask REST app running locally with metricbeat and responding to a metricbeat http json poller, answering with the result of your custom check. (The event goes to ES...)
The external program could do everything and log the result to a file which you point filebeat to so it get sent to ES.
Basically at this point it really depends on the path of least resistance for you and your usecase. I would pick a beat like metricbeat or filebeat and add the rest around it to delegate what I can to a beat and implement only the business logic (UUID and timestamp) in the custom external part.
Created a feature request
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.