Graylog is a very interesting tool, which if you are administering really huge systems, is worth to have.
But sometimes we may want some of it data programatically, while graylog is awesome and has an awesome REST API and has nice documentation, recently, I wanted to know if there was a mean to get the message in/out throughput that usually appears on its dashboard, it was crazy, its something that’s supposed to be easy, since we basically have ALL information via its API.
So this is what I was looking for:
After not finding anything, I decided to dig around myself, hohohoho, found that lil bugger, and thanks to the awesomeness of jq, we can find it quick, e.g
curl -s 'http://user:firstname.lastname@example.org:12900/system/metrics/' |jq '.gauges|.["org.graylog2.throughput.input.1-sec-rate"].value' 4000 curl -s 'http://user:email@example.com:12900/system/metrics/' |jq '.gauges|.["org.graylog2.throughput.output.1-sec-rate"].value' 3905
Cool, end of story.