Created
June 12, 2014 22:50
-
-
Save 4BitBen/91257462455e570931e3 to your computer and use it in GitHub Desktop.
logstash-iostat
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
# Processes iostat output | |
# >iostat -d -m -x sda sdb 1 | bin/logstash -f iostat.conf | |
# | |
# Sample Output: | |
# | |
# Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util | |
# sda 3.36 174.28 9.64 183.71 65.17 1431.99 15.49 0.61 3.16 0.09 1.65 | |
# sdb 0.00 0.00 742.87 4110.46 5830.48 16441.82 9.18 4.90 0.98 0.11 55.45 | |
input { | |
stdin {} | |
} | |
filter { | |
if [message] == "" or [message] =~ "^Device:" { | |
drop {} | |
} | |
grok { | |
match => ["message", "%{DATA:device} +%{NUMBER:read_request_merge_avg:float} +%{NUMBER:write_request_merge_avg:float} +%{NUMBER:read_iops_avg:float} +%{NUMBER:write_iops_avg:float} +%{NUMBER:MB_read_avg:float} +%{NUMBER:MB_write_avg:float} +%{NUMBER:avg_sector_size:float} +%{NUMBER:avg_queue_size:float} +%{NUMBER:io_wait_time_ms:float} +%{NUMBER:io_service_time_ms:float} +%{NUMBER:disk_util_perc:float}"] | |
} | |
} | |
output { | |
#stdout { | |
# codec => "rubydebug" | |
#} | |
} |
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
{ | |
"title": "Disk Statistics", | |
"services": { | |
"query": { | |
"list": { | |
"1": { | |
"id": 1, | |
"color": "#7EB26D", | |
"alias": "", | |
"pin": false, | |
"type": "lucene", | |
"enable": true, | |
"query": "*" | |
} | |
}, | |
"ids": [ | |
1 | |
] | |
}, | |
"filter": { | |
"list": { | |
"0": { | |
"type": "time", | |
"field": "@timestamp", | |
"from": "now-5m", | |
"to": "now", | |
"mandate": "must", | |
"active": true, | |
"alias": "", | |
"id": 0 | |
}, | |
"1": { | |
"type": "querystring", | |
"query": "device:dm-0", | |
"mandate": "must", | |
"active": true, | |
"alias": "", | |
"id": 1 | |
} | |
}, | |
"ids": [ | |
0, | |
1 | |
] | |
} | |
}, | |
"rows": [ | |
{ | |
"title": "Graph", | |
"height": "175px", | |
"editable": true, | |
"collapse": false, | |
"collapsable": true, | |
"panels": [ | |
{ | |
"span": 6, | |
"editable": true, | |
"type": "histogram", | |
"loadingEditor": false, | |
"mode": "mean", | |
"time_field": "@timestamp", | |
"value_field": "read_iops_avg", | |
"x-axis": true, | |
"y-axis": true, | |
"scale": 1, | |
"y_format": "none", | |
"grid": { | |
"max": null, | |
"min": 0 | |
}, | |
"queries": { | |
"mode": "all", | |
"ids": [ | |
1 | |
] | |
}, | |
"annotate": { | |
"enable": false, | |
"query": "*", | |
"size": 20, | |
"field": "_type", | |
"sort": [ | |
"_score", | |
"desc" | |
] | |
}, | |
"auto_int": true, | |
"resolution": 100, | |
"interval": "1s", | |
"intervals": [ | |
"auto", | |
"1s", | |
"1m", | |
"5m", | |
"10m", | |
"30m", | |
"1h", | |
"3h", | |
"12h", | |
"1d", | |
"1w", | |
"1y" | |
], | |
"lines": true, | |
"fill": 3, | |
"linewidth": 3, | |
"points": false, | |
"pointradius": 5, | |
"bars": false, | |
"stack": true, | |
"spyable": true, | |
"zoomlinks": true, | |
"options": true, | |
"legend": false, | |
"show_query": true, | |
"interactive": true, | |
"legend_counts": true, | |
"timezone": "browser", | |
"percentage": false, | |
"zerofill": true, | |
"derivative": false, | |
"tooltip": { | |
"value_type": "cumulative", | |
"query_as_alias": true | |
}, | |
"title": "Avg Read IOPS" | |
}, | |
{ | |
"span": 6, | |
"editable": true, | |
"type": "histogram", | |
"loadingEditor": false, | |
"mode": "mean", | |
"time_field": "@timestamp", | |
"value_field": "MB_read_avg", | |
"x-axis": true, | |
"y-axis": true, | |
"scale": 1, | |
"y_format": "none", | |
"grid": { | |
"max": null, | |
"min": 0 | |
}, | |
"queries": { | |
"mode": "all", | |
"ids": [ | |
1 | |
] | |
}, | |
"annotate": { | |
"enable": false, | |
"query": "*", | |
"size": 20, | |
"field": "_type", | |
"sort": [ | |
"_score", | |
"desc" | |
] | |
}, | |
"auto_int": true, | |
"resolution": 100, | |
"interval": "1s", | |
"intervals": [ | |
"auto", | |
"1s", | |
"1m", | |
"5m", | |
"10m", | |
"30m", | |
"1h", | |
"3h", | |
"12h", | |
"1d", | |
"1w", | |
"1y" | |
], | |
"lines": true, | |
"fill": 3, | |
"linewidth": 3, | |
"points": false, | |
"pointradius": 5, | |
"bars": false, | |
"stack": true, | |
"spyable": true, | |
"zoomlinks": true, | |
"options": true, | |
"legend": false, | |
"show_query": true, | |
"interactive": true, | |
"legend_counts": true, | |
"timezone": "browser", | |
"percentage": false, | |
"zerofill": true, | |
"derivative": false, | |
"tooltip": { | |
"value_type": "cumulative", | |
"query_as_alias": true | |
}, | |
"title": "Avg Read MB/sec" | |
}, | |
{ | |
"span": 6, | |
"editable": true, | |
"type": "histogram", | |
"loadingEditor": false, | |
"mode": "mean", | |
"time_field": "@timestamp", | |
"value_field": "write_iops_avg", | |
"x-axis": true, | |
"y-axis": true, | |
"scale": 1, | |
"y_format": "none", | |
"grid": { | |
"max": null, | |
"min": 0 | |
}, | |
"queries": { | |
"mode": "all", | |
"ids": [ | |
1 | |
] | |
}, | |
"annotate": { | |
"enable": false, | |
"query": "*", | |
"size": 20, | |
"field": "_type", | |
"sort": [ | |
"_score", | |
"desc" | |
] | |
}, | |
"auto_int": true, | |
"resolution": 100, | |
"interval": "1s", | |
"intervals": [ | |
"auto", | |
"1s", | |
"1m", | |
"5m", | |
"10m", | |
"30m", | |
"1h", | |
"3h", | |
"12h", | |
"1d", | |
"1w", | |
"1y" | |
], | |
"lines": true, | |
"fill": 3, | |
"linewidth": 3, | |
"points": false, | |
"pointradius": 5, | |
"bars": false, | |
"stack": true, | |
"spyable": true, | |
"zoomlinks": true, | |
"options": true, | |
"legend": false, | |
"show_query": true, | |
"interactive": true, | |
"legend_counts": true, | |
"timezone": "browser", | |
"percentage": false, | |
"zerofill": true, | |
"derivative": false, | |
"tooltip": { | |
"value_type": "cumulative", | |
"query_as_alias": true | |
}, | |
"title": "Avg Write IOPS" | |
}, | |
{ | |
"span": 6, | |
"editable": true, | |
"type": "histogram", | |
"loadingEditor": false, | |
"mode": "mean", | |
"time_field": "@timestamp", | |
"value_field": "MB_write_avg", | |
"x-axis": true, | |
"y-axis": true, | |
"scale": 1, | |
"y_format": "none", | |
"grid": { | |
"max": null, | |
"min": 0 | |
}, | |
"queries": { | |
"mode": "all", | |
"ids": [ | |
1 | |
] | |
}, | |
"annotate": { | |
"enable": false, | |
"query": "*", | |
"size": 20, | |
"field": "_type", | |
"sort": [ | |
"_score", | |
"desc" | |
] | |
}, | |
"auto_int": true, | |
"resolution": 100, | |
"interval": "1s", | |
"intervals": [ | |
"auto", | |
"1s", | |
"1m", | |
"5m", | |
"10m", | |
"30m", | |
"1h", | |
"3h", | |
"12h", | |
"1d", | |
"1w", | |
"1y" | |
], | |
"lines": true, | |
"fill": 3, | |
"linewidth": 3, | |
"points": false, | |
"pointradius": 5, | |
"bars": false, | |
"stack": true, | |
"spyable": true, | |
"zoomlinks": true, | |
"options": true, | |
"legend": false, | |
"show_query": true, | |
"interactive": true, | |
"legend_counts": true, | |
"timezone": "browser", | |
"percentage": false, | |
"zerofill": true, | |
"derivative": false, | |
"tooltip": { | |
"value_type": "cumulative", | |
"query_as_alias": true | |
}, | |
"title": "Avg Write MB/sec" | |
}, | |
{ | |
"span": 3, | |
"editable": true, | |
"type": "histogram", | |
"loadingEditor": false, | |
"mode": "mean", | |
"time_field": "@timestamp", | |
"value_field": "avg_queue_size", | |
"x-axis": true, | |
"y-axis": true, | |
"scale": 1, | |
"y_format": "none", | |
"grid": { | |
"max": null, | |
"min": 0 | |
}, | |
"queries": { | |
"mode": "all", | |
"ids": [ | |
1 | |
] | |
}, | |
"annotate": { | |
"enable": false, | |
"query": "*", | |
"size": 20, | |
"field": "_type", | |
"sort": [ | |
"_score", | |
"desc" | |
] | |
}, | |
"auto_int": true, | |
"resolution": 100, | |
"interval": "1s", | |
"intervals": [ | |
"auto", | |
"1s", | |
"1m", | |
"5m", | |
"10m", | |
"30m", | |
"1h", | |
"3h", | |
"12h", | |
"1d", | |
"1w", | |
"1y" | |
], | |
"lines": true, | |
"fill": 3, | |
"linewidth": 3, | |
"points": false, | |
"pointradius": 5, | |
"bars": false, | |
"stack": true, | |
"spyable": true, | |
"zoomlinks": true, | |
"options": true, | |
"legend": false, | |
"show_query": true, | |
"interactive": true, | |
"legend_counts": true, | |
"timezone": "browser", | |
"percentage": false, | |
"zerofill": true, | |
"derivative": false, | |
"tooltip": { | |
"value_type": "cumulative", | |
"query_as_alias": true | |
}, | |
"title": "Avg Queue Size" | |
}, | |
{ | |
"span": 3, | |
"editable": true, | |
"type": "histogram", | |
"loadingEditor": false, | |
"mode": "mean", | |
"time_field": "@timestamp", | |
"value_field": "io_wait_time_ms", | |
"x-axis": true, | |
"y-axis": true, | |
"scale": 1, | |
"y_format": "none", | |
"grid": { | |
"max": null, | |
"min": 0 | |
}, | |
"queries": { | |
"mode": "all", | |
"ids": [ | |
1 | |
] | |
}, | |
"annotate": { | |
"enable": false, | |
"query": "*", | |
"size": 20, | |
"field": "_type", | |
"sort": [ | |
"_score", | |
"desc" | |
] | |
}, | |
"auto_int": true, | |
"resolution": 100, | |
"interval": "1s", | |
"intervals": [ | |
"auto", | |
"1s", | |
"1m", | |
"5m", | |
"10m", | |
"30m", | |
"1h", | |
"3h", | |
"12h", | |
"1d", | |
"1w", | |
"1y" | |
], | |
"lines": true, | |
"fill": 3, | |
"linewidth": 3, | |
"points": false, | |
"pointradius": 5, | |
"bars": false, | |
"stack": true, | |
"spyable": true, | |
"zoomlinks": true, | |
"options": true, | |
"legend": false, | |
"show_query": true, | |
"interactive": true, | |
"legend_counts": true, | |
"timezone": "browser", | |
"percentage": false, | |
"zerofill": true, | |
"derivative": false, | |
"tooltip": { | |
"value_type": "cumulative", | |
"query_as_alias": true | |
}, | |
"title": "Avg Wait Time (ms)" | |
}, | |
{ | |
"span": 3, | |
"editable": true, | |
"type": "histogram", | |
"loadingEditor": false, | |
"mode": "mean", | |
"time_field": "@timestamp", | |
"value_field": "io_service_time_ms", | |
"x-axis": true, | |
"y-axis": true, | |
"scale": 1, | |
"y_format": "none", | |
"grid": { | |
"max": null, | |
"min": 0 | |
}, | |
"queries": { | |
"mode": "all", | |
"ids": [ | |
1 | |
] | |
}, | |
"annotate": { | |
"enable": false, | |
"query": "*", | |
"size": 20, | |
"field": "_type", | |
"sort": [ | |
"_score", | |
"desc" | |
] | |
}, | |
"auto_int": true, | |
"resolution": 100, | |
"interval": "1s", | |
"intervals": [ | |
"auto", | |
"1s", | |
"1m", | |
"5m", | |
"10m", | |
"30m", | |
"1h", | |
"3h", | |
"12h", | |
"1d", | |
"1w", | |
"1y" | |
], | |
"lines": true, | |
"fill": 3, | |
"linewidth": 3, | |
"points": false, | |
"pointradius": 5, | |
"bars": false, | |
"stack": true, | |
"spyable": true, | |
"zoomlinks": true, | |
"options": true, | |
"legend": false, | |
"show_query": true, | |
"interactive": true, | |
"legend_counts": true, | |
"timezone": "browser", | |
"percentage": false, | |
"zerofill": true, | |
"derivative": false, | |
"tooltip": { | |
"value_type": "cumulative", | |
"query_as_alias": true | |
}, | |
"title": "Avg Response Time (ms)" | |
}, | |
{ | |
"span": 3, | |
"editable": true, | |
"type": "histogram", | |
"loadingEditor": false, | |
"mode": "mean", | |
"time_field": "@timestamp", | |
"value_field": "disk_util_perc", | |
"x-axis": true, | |
"y-axis": true, | |
"scale": 1, | |
"y_format": "none", | |
"grid": { | |
"max": null, | |
"min": 0 | |
}, | |
"queries": { | |
"mode": "all", | |
"ids": [ | |
1 | |
] | |
}, | |
"annotate": { | |
"enable": false, | |
"query": "*", | |
"size": 20, | |
"field": "_type", | |
"sort": [ | |
"_score", | |
"desc" | |
] | |
}, | |
"auto_int": true, | |
"resolution": 100, | |
"interval": "1s", | |
"intervals": [ | |
"auto", | |
"1s", | |
"1m", | |
"5m", | |
"10m", | |
"30m", | |
"1h", | |
"3h", | |
"12h", | |
"1d", | |
"1w", | |
"1y" | |
], | |
"lines": true, | |
"fill": 3, | |
"linewidth": 3, | |
"points": false, | |
"pointradius": 5, | |
"bars": false, | |
"stack": true, | |
"spyable": true, | |
"zoomlinks": true, | |
"options": true, | |
"legend": false, | |
"show_query": true, | |
"interactive": true, | |
"legend_counts": true, | |
"timezone": "browser", | |
"percentage": false, | |
"zerofill": true, | |
"derivative": false, | |
"tooltip": { | |
"value_type": "cumulative", | |
"query_as_alias": true | |
}, | |
"title": "Avg Disk Utilization Percentage", | |
"scaleSeconds": false | |
} | |
], | |
"notice": false | |
}, | |
{ | |
"title": "Events", | |
"height": "350px", | |
"editable": true, | |
"collapse": false, | |
"collapsable": true, | |
"panels": [ | |
{ | |
"title": "All events", | |
"error": false, | |
"span": 12, | |
"editable": true, | |
"group": [ | |
"default" | |
], | |
"type": "table", | |
"size": 100, | |
"pages": 5, | |
"offset": 0, | |
"sort": [ | |
"@timestamp", | |
"desc" | |
], | |
"style": { | |
"font-size": "9pt" | |
}, | |
"overflow": "min-height", | |
"fields": [ | |
"@timestamp", | |
"device", | |
"read_iops_avg", | |
"MB_read_avg", | |
"write_iops_avg", | |
"MB_write_avg", | |
"avg_queue_size", | |
"io_wait_time_ms", | |
"io_service_time_ms", | |
"disk_util_perc" | |
], | |
"localTime": true, | |
"timeField": "@timestamp", | |
"highlight": [], | |
"sortable": true, | |
"header": true, | |
"paging": true, | |
"spyable": true, | |
"queries": { | |
"mode": "all", | |
"ids": [ | |
1 | |
] | |
}, | |
"field_list": true, | |
"status": "Stable", | |
"trimFactor": 300, | |
"normTimes": true, | |
"all_fields": false | |
} | |
], | |
"notice": false | |
} | |
], | |
"editable": true, | |
"failover": false, | |
"index": { | |
"interval": "day", | |
"pattern": "[logstash-]YYYY.MM.DD", | |
"default": "NO_TIME_FILTER_OR_INDEX_PATTERN_NOT_MATCHED", | |
"warm_fields": true | |
}, | |
"style": "dark", | |
"panel_hints": true, | |
"pulldowns": [ | |
{ | |
"type": "query", | |
"collapse": true, | |
"notice": false, | |
"query": "*", | |
"pinned": true, | |
"history": [ | |
"*", | |
"read_iops_avg:*", | |
"write_iops_avg:*", | |
"device:dm-0" | |
], | |
"remember": 10, | |
"enable": true | |
}, | |
{ | |
"type": "filtering", | |
"collapse": true, | |
"notice": true, | |
"enable": true | |
} | |
], | |
"nav": [ | |
{ | |
"type": "timepicker", | |
"collapse": false, | |
"notice": false, | |
"status": "Stable", | |
"time_options": [ | |
"5m", | |
"15m", | |
"1h", | |
"6h", | |
"12h", | |
"24h", | |
"2d", | |
"7d", | |
"30d" | |
], | |
"refresh_intervals": [ | |
"5s", | |
"10s", | |
"30s", | |
"1m", | |
"5m", | |
"15m", | |
"30m", | |
"1h", | |
"2h", | |
"1d" | |
], | |
"timefield": "@timestamp", | |
"now": true, | |
"filter_id": 0, | |
"enable": true | |
} | |
], | |
"loader": { | |
"save_gist": false, | |
"save_elasticsearch": true, | |
"save_local": true, | |
"save_default": true, | |
"save_temp": true, | |
"save_temp_ttl_enable": true, | |
"save_temp_ttl": "30d", | |
"load_gist": true, | |
"load_elasticsearch": true, | |
"load_elasticsearch_size": 20, | |
"load_local": true, | |
"hide": false | |
}, | |
"refresh": "30s" | |
} |
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
#!/bin/sh | |
iostat -d -m -x sda sdb 1 | bin/logstash -f iostat.conf |
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
# Processes iostat output | |
# >iostat -d -m sda sdb 1 | bin/logstash -f iostat.conf | |
# | |
# Sample Output: | |
# | |
#Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn | |
#sda 0.00 0.00 0.00 0 0 | |
#dm-0 1935.00 1548.00 6792.00 1548 6792 | |
input { | |
stdin {} | |
} | |
filter { | |
if [message] == "" or [message] =~ "^Device:" { | |
drop {} | |
} | |
grok { | |
match => ["message", "%{DATA:device} +%{NUMBER:iops:float} +%{NUMBER:MB_read_avg:float} +%{NUMBER:MB_write_avg:float} +%{NUMBER:MB_read_total:int} +%{NUMBER:MB_write_total:int}"] | |
} | |
} | |
output { | |
#stdout { | |
# codec => "rubydebug" | |
#} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment