Skip to content

Instantly share code, notes, and snippets.

@simianhacker
Last active April 21, 2020 14:31
Show Gist options
  • Save simianhacker/236eb4327d7562bca46cf124616a4411 to your computer and use it in GitHub Desktop.
Save simianhacker/236eb4327d7562bca46cf124616a4411 to your computer and use it in GitHub Desktop.
Demystifying Rates in TSVB
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}"},"title":"TSVB Example: Events Per Second","uiStateJSON":"{}","version":1,"visState":"{\"type\":\"metrics\",\"aggs\":[],\"params\":{\"axis_formatter\":\"number\",\"axis_position\":\"left\",\"axis_scale\":\"normal\",\"default_index_pattern\":\"metricbeat-*\",\"default_timefield\":\"@timestamp\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"index_pattern\":\"kibana_sample*\",\"interval\":\">=10m\",\"isModelInvalid\":false,\"series\":[{\"axis_position\":\"right\",\"chart_type\":\"bar\",\"color\":\"rgba(104,204,202,1)\",\"fill\":\"1\",\"formatter\":\"number\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"line_width\":\"0\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"count\"},{\"id\":\"d2ea8870-79a2-11ea-8742-197c8d25f072\",\"type\":\"math\",\"variables\":[{\"id\":\"d745a530-79a2-11ea-8742-197c8d25f072\",\"name\":\"count\",\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\"}],\"script\":\"params.count / (params._interval / 1000)\"}],\"point_size\":1,\"separate_axis\":0,\"split_mode\":\"filters\",\"stacked\":\"stacked\",\"terms_field\":\"tags.keyword\",\"split_filters\":[{\"filter\":{\"query\":\"tags.keyword: \\\"info\\\"\",\"language\":\"kuery\"},\"label\":\"Info\",\"color\":\"rgba(104,204,202,1)\",\"id\":\"cc0dc620-792f-11ea-8742-197c8d25f072\"},{\"filter\":{\"query\":\"tags.keyword: \\\"error\\\"\",\"language\":\"kuery\"},\"label\":\"Errors\",\"color\":\"rgba(171,20,158,1)\",\"id\":\"d9a08160-792f-11ea-8742-197c8d25f072\"}],\"label\":\"Events Per Second\",\"type\":\"timeseries\",\"value_template\":\"{{value}}/s\"}],\"show_grid\":1,\"show_legend\":1,\"time_field\":\"@timestamp\",\"type\":\"timeseries\",\"legend_position\":\"bottom\"},\"title\":\"TSVB Example: Events Per Second\"}"},"id":"9b936620-79a3-11ea-92a1-e157520c18d2","migrationVersion":{"visualization":"7.7.0"},"references":[],"type":"visualization","updated_at":"2020-04-08T14:16:58.498Z","version":"WzYxLDFd"}
{"attributes":{"description":"This visualization is an example of how to display a positive and negative rate of change by color on a single metric.","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}"},"title":"TSVB Example: Rate of Change","uiStateJSON":"{}","version":1,"visState":"{\"type\":\"metrics\",\"aggs\":[],\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"234494f0-79da-11ea-9b13-43c68aaf94df\",\"color\":\"rgba(15,20,25,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"234642a0-79da-11ea-9b13-43c68aaf94df\",\"type\":\"avg\",\"field\":\"system.cpu.user.pct\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"percent\",\"chart_type\":\"line\",\"line_width\":\"2\",\"point_size\":\"1\",\"fill\":\"0\",\"stacked\":\"none\",\"label\":\"Average CPU Usage\",\"type\":\"timeseries\",\"value_template\":\"{{value}}\",\"filter\":{\"query\":\"\",\"language\":\"kuery\"},\"terms_field\":\"event.dataset\",\"split_color_mode\":\"rainbow\",\"steps\":0,\"terms_order_by\":\"_key\",\"terms_direction\":\"desc\",\"terms_size\":\"20\",\"hidden\":false},{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"rgba(104,204,202,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"system.cpu.user.pct\"},{\"unit\":\"\",\"id\":\"50adf5c0-78f5-11ea-8dff-c7d69e60dbd1\",\"type\":\"derivative\",\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\"},{\"id\":\"57fef9f0-78f5-11ea-8dff-c7d69e60dbd1\",\"type\":\"calculation\",\"variables\":[{\"id\":\"5ae85e40-78f5-11ea-8dff-c7d69e60dbd1\",\"name\":\"diff\",\"field\":\"50adf5c0-78f5-11ea-8dff-c7d69e60dbd1\"},{\"id\":\"c001f7c0-79d9-11ea-9b13-43c68aaf94df\",\"name\":\"cpu\",\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\"}],\"script\":\"params.diff > 0 ? (params.cpu / (params.cpu - params.diff)) - 1 : null\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"percent\",\"chart_type\":\"bar\",\"line_width\":\"1\",\"point_size\":\"1\",\"fill\":\"1\",\"stacked\":\"none\",\"label\":\"Positive Rate of Change\",\"type\":\"timeseries\",\"value_template\":\"{{value}}\",\"filter\":{\"query\":\"\",\"language\":\"kuery\"},\"terms_field\":\"event.dataset\",\"split_color_mode\":\"rainbow\",\"steps\":0,\"terms_order_by\":\"_key\",\"terms_direction\":\"desc\",\"terms_size\":\"20\",\"hidden\":false},{\"id\":\"ce08df30-78f5-11ea-8dff-c7d69e60dbd1\",\"color\":\"rgba(171,20,158,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"ce08df31-78f5-11ea-8dff-c7d69e60dbd1\",\"type\":\"avg\",\"field\":\"system.cpu.user.pct\"},{\"unit\":\"\",\"id\":\"ce08df32-78f5-11ea-8dff-c7d69e60dbd1\",\"type\":\"derivative\",\"field\":\"ce08df31-78f5-11ea-8dff-c7d69e60dbd1\"},{\"id\":\"ce08df34-78f5-11ea-8dff-c7d69e60dbd1\",\"type\":\"calculation\",\"variables\":[{\"id\":\"ce08df33-78f5-11ea-8dff-c7d69e60dbd1\",\"name\":\"diff\",\"field\":\"ce08df32-78f5-11ea-8dff-c7d69e60dbd1\"},{\"id\":\"fe5e2bb0-79d9-11ea-9b13-43c68aaf94df\",\"name\":\"cpu\",\"field\":\"ce08df31-78f5-11ea-8dff-c7d69e60dbd1\"}],\"script\":\"params.diff < 0 ? (params.cpu / (params.cpu - params.diff)) - 1 : null\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"bar\",\"line_width\":\"1\",\"point_size\":\"1\",\"fill\":\"1\",\"stacked\":\"none\",\"label\":\"Negative Rate of Change\",\"type\":\"timeseries\",\"value_template\":\"{{value}}\",\"filter\":{\"query\":\"\",\"language\":\"kuery\"},\"terms_field\":\"event.dataset\",\"split_color_mode\":\"rainbow\",\"steps\":0,\"terms_order_by\":\"_key\",\"terms_direction\":\"desc\",\"terms_size\":\"20\",\"hidden\":false}],\"time_field\":\"\",\"index_pattern\":\"\",\"interval\":\">=10s\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"default_index_pattern\":\"metricbeat-*\",\"default_timefield\":\"@timestamp\",\"isModelInvalid\":false,\"legend_position\":\"bottom\"},\"title\":\"TSVB Example: Rate of Change\"}"},"id":"3c5283b0-78f6-11ea-bde9-0d80ac6c0629","migrationVersion":{"visualization":"7.7.0"},"references":[],"type":"visualization","updated_at":"2020-04-08T20:48:40.489Z","version":"Wzc0LDFd"}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}"},"title":"TSVB Example: Positive Rate for Outbound Traffic","uiStateJSON":"{}","version":1,"visState":"{\"type\":\"metrics\",\"aggs\":[],\"params\":{\"axis_formatter\":\"number\",\"axis_position\":\"left\",\"axis_scale\":\"normal\",\"default_index_pattern\":\"metricbeat-*\",\"default_timefield\":\"@timestamp\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"index_pattern\":\"\",\"interval\":\">=10s\",\"isModelInvalid\":false,\"legend_position\":\"bottom\",\"series\":[{\"axis_position\":\"right\",\"chart_type\":\"bar\",\"color\":\"rgba(104,204,202,1)\",\"fill\":\"1\",\"filter\":{\"language\":\"kuery\",\"query\":\"host.name: \\\"SimianHacker-Laptop.local\\\" and system.network.name : \\\"en0\\\" \"},\"formatter\":\"bytes\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"label\":\"Outbound Traffic\",\"line_width\":\"0\",\"metrics\":[{\"field\":\"system.network.out.bytes\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"max\"},{\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"id\":\"0ad6d100-7901-11ea-8742-197c8d25f072\",\"type\":\"derivative\",\"unit\":\"1s\"},{\"field\":\"0ad6d100-7901-11ea-8742-197c8d25f072\",\"id\":\"94f5db10-7901-11ea-8742-197c8d25f072\",\"type\":\"positive_only\",\"unit\":\"\"}],\"point_size\":1,\"separate_axis\":0,\"split_mode\":\"filter\",\"stacked\":\"none\",\"type\":\"timeseries\",\"value_template\":\"{{value}}/s\"}],\"show_grid\":1,\"show_legend\":1,\"time_field\":\"\",\"type\":\"timeseries\"},\"title\":\"TSVB Example: Positive Rate for Outbound Traffic\"}"},"id":"ace2e2e0-7901-11ea-bde9-0d80ac6c0629","migrationVersion":{"visualization":"7.7.0"},"references":[],"type":"visualization","updated_at":"2020-04-09T22:16:55.342Z","version":"WzExMCwxXQ=="}
{"exportedCount":3,"missingRefCount":0,"missingReferences":[]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment