Skip to content

Instantly share code, notes, and snippets.

@jsvd
Last active September 4, 2020 09:51
Show Gist options
  • Save jsvd/e0e9e934f497fd895b9d6518d5a7aa83 to your computer and use it in GitHub Desktop.
Save jsvd/e0e9e934f497fd895b9d6518d5a7aa83 to your computer and use it in GitHub Desktop.
❯ curl -s localhost:9600/_node/stats | jq '.pipelines.main.plugins.filters[] | select(.events.in!=.events.out)'
{
  "id": "75afda0f03a5af46279c4cba9408ca87664b9c988bf477e2a2cca535e59e856f",
  "events": {
    "in": 1,
    "out": 0,
    "duration_in_millis": 5
  },
  "name": "drop"
}
❯ curl -s localhost:9600/_node/pipelines?graph=true | jq '.pipelines.main.graph.graph.vertices[] | select(.id=="75afda0f03a5af46279c4cba9408ca87664b9c988bf477e2a2cca535e59e856f")'
{
  "config_name": "drop",
  "plugin_type": "filter",
  "meta": {
    "source": {
      "protocol": "file",
      "id": "/private/tmp/logstash-7.9.1/cfg",
      "line": 10,
      "column": 5
    }
  },
  "id": "75afda0f03a5af46279c4cba9408ca87664b9c988bf477e2a2cca535e59e856f",
  "explicit_id": false,
  "type": "plugin"
}
❯ cat /private/tmp/logstash-7.9.1/cfg|  ruby -e '$stdin.read.split("\n").each_with_index {|l, i| puts "#{i+1}: #{l}" if (i+1).between?(9, 12) }' 
9:   } else if [message] == "d" {
10:     drop {}
11:   } else if [message] == "e" {
12:     drop {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment