Monitoring APIs
editMonitoring APIs
editLogstash provides the following monitoring APIs to retrieve runtime metrics about Logstash:
You can use the root resource to retrieve general information about the Logstash instance, including the host and version.
curl -XGET 'localhost:9600/?pretty'
Example response:
{ "host": "skywalker", "version": "6.8.23", "http_address": "127.0.0.1:9600" }
By default, the monitoring API attempts to bind to tcp:9600
. If this port is already in use by another Logstash
instance, you need to launch Logstash with the --http.port
flag specified to bind to a different port. See
Command-Line Flags for more information.
Common Options
editThe following options can be applied to all of the Logstash monitoring APIs.
Pretty Results
editWhen appending ?pretty=true
to any request made, the JSON returned
will be pretty formatted (use it for debugging only!).
Human-Readable Output
editFor Logstash 6.8.23, the human
option is supported for the Hot Threads API
only. When you specify human=true
, the results are returned in plain text instead of
JSON format. The default is false.
Statistics are returned in a format suitable for humans
(eg "exists_time": "1h"
or "size": "1kb"
) and for computers
(eg "exists_time_in_millis": 3600000
or "size_in_bytes": 1024
).
The human-readable values can be turned off by adding ?human=false
to the query string. This makes sense when the stats results are
being consumed by a monitoring tool, rather than intended for human
consumption. The default for the human
flag is
false
.