Skip to content

Instantly share code, notes, and snippets.

@shcallaway
Created February 28, 2020 00:16
Show Gist options
  • Save shcallaway/4957d8e66e014abd5e6ef6eef774f60f to your computer and use it in GitHub Desktop.
Save shcallaway/4957d8e66e014abd5e6ef6eef774f60f to your computer and use it in GitHub Desktop.
Use curl to see Logstash metrics

You can get some really detailed stats about Logstash pipelines via the HTTP API. See the docs for more!

$ curl -XGET 'localhost:9600/_node/stats/pipelines?pretty'
{
  "host" : "logstash-msk-679b6b8dd9-4pd2h",
  "version" : "7.4.0",
  "http_address" : "0.0.0.0:9600",
  "id" : "ba41dded-1a12-41e9-988f-03bd4eae9d4a",
  "name" : "logstash-msk-679b6b8dd9-4pd2h",
  "ephemeral_id" : "c3f31770-6edc-404e-ab60-dcd5be7b0b56",
  "status" : "green",
  "snapshot" : false,
  "pipeline" : {
    "workers" : 2,
    "batch_size" : 125,
    "batch_delay" : 50
  },
  "pipelines" : {
    "main" : {
      "events" : {
        "queue_push_duration_in_millis" : 5353,
        "filtered" : 5177202,
        "duration_in_millis" : 8811,
        "out" : 5177202,
        "in" : 5177203
      },
      "plugins" : {
        "inputs" : [ {
          "id" : "fec8d3a8f298f6c82b4e8f57d8ad560b523a9094a92a3124e862ea18eb84e033",
          "current_connections" : 15,
          "events" : {
            "queue_push_duration_in_millis" : 5353,
            "out" : 5177203
          },
          "peak_connections" : 15,
          "name" : "beats"
        } ],
        "codecs" : [ {
          "id" : "plain_bf7fc870-7c6c-4560-a153-5d2c865a15e0",
          "encode" : {
            "writes_in" : 0,
            "duration_in_millis" : 0
          },
          "name" : "plain",
          "decode" : {
            "writes_in" : 0,
            "duration_in_millis" : 0,
            "out" : 0
          }
        }, {
          "id" : "json_3765061c-5b76-4bfa-96f7-e67018f1063f",
          "encode" : {
            "writes_in" : 0,
            "duration_in_millis" : 0
          },
          "name" : "json",
          "decode" : {
            "writes_in" : 0,
            "duration_in_millis" : 0,
            "out" : 0
          }
        } ],
        "filters" : [ {
          "id" : "2dd178768e9015a23debfc494fafe198e4cfdbf68887dea97cc5514bc4bec452",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "f406b02f8b2847eaf8fe7f149a0b106bc89073008890af7a16383729b2644bb3",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "118b33168baa4892741555906b5c0233fe6a488489a63d3ccdab14ad65b3b98a",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "date"
        }, {
          "id" : "9377a990cef9c0abc6fd39e1c9213fb3ea92aac06a6b8e08cd3f7c774ae8bc8e",
          "events" : {
            "duration_in_millis" : 26,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "b43799cac274981d9634398a63b8bc15a99151b2f2c38fecbd87e97438f925e3",
          "events" : {
            "duration_in_millis" : 28,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "e22c71fcb2f63fe691cba7ec8454046da48e117e8219bef353253390b60e6294",
          "events" : {
            "duration_in_millis" : 7933,
            "out" : 0,
            "in" : 5177202
          },
          "name" : "drop"
        }, {
          "id" : "af31b26c2b1f73564b842613433edbe5d99bbee388f1a8b4ea0dc1f3d949e68e",
          "events" : {
            "duration_in_millis" : 27,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "b0e0affc17ee8f8ced502d3807361d21cf18c63b4d69caae0a47ed56e4020822",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "957c8c1935aba20d4106b7c03243ab8e7e5cf278df3fe2b68db6f83ef161a31c",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "date"
        }, {
          "id" : "2fe9e925d32a0f5079e9c5cfc51aeca92d0d105a8a50cda4fc3f42f727f614d9",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "d6770c891c90fdf66aa626af6e2ae83d65f73c9b3841f91dbc12433db5d2c08a",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "2c7bf527c9c40fdec299bb6a9818f2a3376792ddca565f9bbc636e8f382a4d00",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "04de962cbd7dd46c0b9b7670190d0a3914ac6bb0e7c46bfc540ecf663f11f45d",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "440044241d1e184f80d2853bb5eab7d4caf356a1e6c0abcaff5f343921640e49",
          "events" : {
            "duration_in_millis" : 0,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "4940131dbbae03888c8ee400e678281c91d37dba19f235d4533524135e4267ec",
          "events" : {
            "duration_in_millis" : 27,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        }, {
          "id" : "32f31239bab7cd62d8bc21d05d08f707e57c81d466e12741043ceab8570d8fc4",
          "events" : {
            "duration_in_millis" : 28,
            "out" : 0,
            "in" : 0
          },
          "name" : "mutate"
        } ],
        "outputs" : [ {
          "id" : "e4044363e87ec703ac5b093c1bbe7d20927a9bb4094593af770402fc9b44fd06",
          "events" : {
            "duration_in_millis" : 24,
            "out" : 0,
            "in" : 0
          },
          "name" : "kafka"
        } ]
      },
      "reloads" : {
        "successes" : 0,
        "last_success_timestamp" : null,
        "last_failure_timestamp" : null,
        "last_error" : null,
        "failures" : 0
      },
      "queue" : {
        "type" : "memory",
        "events_count" : 0,
        "queue_size_in_bytes" : 0,
        "max_queue_size_in_bytes" : 0
      },
      "hash" : "0c15ea9a3bcae1088179032e96b595c08b8dcd1800b31e46747d1a143fde5532",
      "ephemeral_id" : "5b9189d0-a939-4878-acf9-43fbd1f30539"
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment