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
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"
}
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.