Logstash-monitoring-apis

提供:Dev Guides
移動先:案内検索

Logstash-モニタリングAPI

Logstashは、パフォーマンスを監視するためのAPIを提供します。 これらの監視APIは、Logstashに関する実行時メトリックを抽出します。

ノード情報API

このAPIは、Logstashのノードに関する情報を取得するために使用されます。 OS、Logstashパイプライン、JVMの情報をJSON形式で返します。

次のURLを使用して、 get 要求をLogstashに送信することにより、情報を抽出できます-

GET http://localhost:9600/_node?pretty

応答

以下はNode Info APIの応答です。

{
   "host" : "Dell-PC",
   "version" : "5.0.1",
   "http_address" : "127.0.0.1:9600",

   "pipeline" : {
      "workers" : 4,
      "batch_size" : 125,
      "batch_delay" : 5,
      "config_reload_automatic" : false,
      "config_reload_interval" : 3
   },
   "os" : {
      "name" : "Windows 7",
      "arch" : "x86",
      "version" : "6.1",
      "available_processors" : 4
   },
   "jvm" : {
      "pid" : 312,
      "version" : "1.8.0_111",
      "vm_name" : "Java HotSpot(TM) Client VM",
      "vm_version" : "1.8.0_111",
      "vm_vendor" : "Oracle Corporation",
      "start_time_in_millis" : 1483770315412,

      "mem" : {
         "heap_init_in_bytes" : 16777216,
         "heap_max_in_bytes" : 1046937600,
         "non_heap_init_in_bytes" : 163840,
         "non_heap_max_in_bytes" : 0
      },
      "gc_collectors" : [ "ParNew", "ConcurrentMarkSweep" ]
   }
}

URLに名前を追加するだけで、Pipeline、OS、JVMの特定の情報を取得することもできます。

GET http://localhost:9600/_node/os?pretty
GET http://localhost:9600/_node/pipeline?pretty
GET http://localhost:9600/_node/jvm?pretty

プラグイン情報API

このAPIは、Logstashにインストールされているプラ​​グインに関する情報を取得するために使用されます。 この情報を取得するには、次のURLにgetリクエストを送信します-

GET http://localhost:9600/_node/plugins?pretty

応答

以下は、プラグイン情報APIの応答です。

{
   "host" : "Dell-PC",
   "version" : "5.0.1",
   "http_address" : "127.0.0.1:9600",
   "total" : 95,
   "plugins" : [ {
      "name" : "logstash-codec-collectd",
      "version" : "3.0.2"
   },
   {
      "name" : "logstash-codec-dots",
      "version" : "3.0.2"
   },
   {
      "name" : "logstash-codec-edn",
      "version" : "3.0.2"
   },
   {
      "name" : "logstash-codec-edn_lines",
      "version" : "3.0.2"
   },
   ............
}

Node Stats API

このAPIは、JSONオブジェクトのLogstash(メモリ、プロセス、JVM、パイプライン)の統計を抽出するために使用されます。 この情報を取得するには、次のURLにgetリクエストを送信します-

GET http://localhost:9600/_node/stats/?pretty
GET http://localhost:9600/_node/stats/process?pretty
GET http://localhost:9600/_node/stats/jvm?pretty
GET http://localhost:9600/_node/stats/pipeline?pretty

ホットスレッドAPI

このAPIは、Logstashのホットスレッドに関する情報を取得します。 ホットスレッドはJavaスレッドで、CPU使用率が高く、通常の実行時間よりも長く実行されます。 この情報を取得するには、次のURLにgetリクエストを送信します-

GET http://localhost:9600/_node/hot_threads?pretty

ユーザーは次のURLを使用して、より読みやすい形式で応答を取得できます。

GET http://localhost:9600/_node/hot_threads?human = true