Graylog Message in/out throughput

12 Oct    porn for geeks

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:

Screen Shot 2015-10-12 at 14.20.21

 

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:pass@gray.log.com:12900/system/metrics/' |jq '.gauges|.["org.graylog2.throughput.input.1-sec-rate"].value'
4000
curl -s 'http://user:pass@gray.log.com:12900/system/metrics/' |jq '.gauges|.["org.graylog2.throughput.output.1-sec-rate"].value'
3905

Cool, end of story.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.