Logstash metrics endpoint

How can I use the logstash metrics endpoint? I can't see any detailed documentation on this.

I have uncommented the following in the logstash.yml file but when I visit :9600/metrics there is just a 404 error.

# ------------ Metrics Settings --------------
#
# Bind address for the metrics REST endpoint
#
http.host: "0.0.0.0"
#
# Bind port for the metrics REST endpoint, this option also accept a range
# (9600-9700) and logstash will pick up the first available ports.
#
http.port: 9600-9700

Any suggestions or articles for attention?

Docs are here... https://www.elastic.co/guide/en/logstash/current/monitoring.html

You can also use the http_poller input of Logstash to collect stats from the API. We use this to create our own monitoring solution for Logstash which meets our needs better than X-Pack..

input {
  # Input plugin to collect Logstash stats from this instance every minute.
  http_poller {
    urls => {
      logstash_stats => {
        method => get
        url => "http://127.0.0.1:9600/_node/stats"
        headers => {
          Accept => "application/json"
        }
      }
    }
    request_timeout => 60
    schedule => { cron => "* * * * * UTC"}
    codec => "json"
    type => "logstash_stats"
  }
}
1 Like

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