Last active
June 16, 2017 13:30
-
-
Save ycombinator/31d2af4b335c8d140d21e617b8dc419d to your computer and use it in GitHub Desktop.
pipeline events throughput across hosts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE i | |
PUT i | |
{ | |
"mappings": { | |
"t": { | |
"properties": { | |
"logstash_stats": { | |
"type": "object", | |
"properties": { | |
"logstash": { | |
"type": "object", | |
"properties": { | |
"uuid": { | |
"type": "keyword" | |
} | |
} | |
}, | |
"pipelines": { | |
"type": "nested", | |
"properties": { | |
"hash": { | |
"type": "keyword" | |
}, | |
"events": { | |
"type": "object", | |
"properties": { | |
"out": { | |
"type": "long" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
POST i/t/1 | |
{ | |
"logstash_stats": { | |
"logstash": { | |
"uuid": "host1" | |
}, | |
"pipelines": [ | |
{ | |
"hash": "pipeline1", | |
"events": { | |
"out": 500 | |
} | |
}, | |
{ | |
"hash": "pipeline2", | |
"events": { | |
"out": 1000 | |
} | |
} | |
] | |
} | |
} | |
POST i/t/2 | |
{ | |
"logstash_stats": { | |
"logstash": { | |
"uuid": "host1" | |
}, | |
"pipelines": [ | |
{ | |
"hash": "pipeline1", | |
"events": { | |
"out": 2000 | |
} | |
} | |
] | |
} | |
} | |
POST i/t/3 | |
{ | |
"logstash_stats": { | |
"logstash": { | |
"uuid": "host2" | |
}, | |
"pipelines": [ | |
{ | |
"hash": "pipeline2", | |
"events": { | |
"out": 3000 | |
} | |
} | |
] | |
} | |
} | |
POST i/_search | |
{ | |
"size": 1, | |
"aggs": { | |
"root_to_pipelines": { | |
"nested": { | |
"path": "logstash_stats.pipelines" | |
}, | |
"aggs": { | |
"per_pipeline": { | |
"terms": { | |
"field": "logstash_stats.pipelines.hash", | |
"size": 10 | |
}, | |
"aggs": { | |
"pipelines_to_root": { | |
"reverse_nested": {}, | |
"aggs": { | |
"per_host": { | |
"terms": { | |
"field": "logstash_stats.logstash.uuid", | |
"size": 10 | |
}, | |
"aggs": { | |
"root_to_pipelines": { | |
"nested": { | |
"path": "logstash_stats.pipelines" | |
}, | |
"aggs": { | |
"max_events_out": { | |
"max": { | |
"field": "logstash_stats.pipelines.events.out", | |
"missing": 0 | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment