We wish to send custom metrics via metricbeat.
Specifically we have an integer, which we can get via a command line argument, from a custom program, which we want to send to elastic via Metricbeat.
We want to do this, because we already have Metricbeat configured and running on all the hosts that also use this custom program.
These hosts know nothing about Elastic, so sending this directly via something like the Python plugin is not an option. They only know Metricbeat, which knows Logstash, which knows Elastic.
So my question is; Can I send the result of a command line argument via Metricbeat to my Elastic?
[email@example.com:~]# customcommand overview Overview: state: 1, files: 15820, packets: 76003203689, bytes: 67948125992425, start: 2021-09-20 09:41:02 UTC, end: 2021-09-22 13:23:12 UTC state: 2, files: 14530, packets: 68331984074, bytes: 62407403745894, start: 2021-09-18 09:24:14 UTC, end: 2021-09-20 09:41:02 UTC Totals: files: 30350, packets: 144335187763, bytes: 130355529738319, start: 2021-09-18 09:24:14 UTC, end: 2021-09-22 13:23:12 UTC data intervals: start: 2021-09-18 09:24:14 UTC, end: 2021-09-22 13:23:12 UTC
I'd basically like to get a histogram in elastic of the number after "state: 1, files: " namely 15820.
So all we want is to send that integer via metricbeat to Elastic.
How would we do this?
We have a gold license, if that is relevant. Also, please say if you need more info, or if something is unclear, or if I have misunderstood anything. I am still relatively new to Elastic.
EDIT: A colleague just made me aware of something called "Prometheus". He said I could make the number available via Prometheus and then have Metricbeat scrape that endpoint: Prometheus module | Metricbeat Reference [7.14] | Elastic - Would this be a good solution?