Skip to content

Instantly share code, notes, and snippets.

@demmer
Created July 23, 2015 13:15
Show Gist options
  • Save demmer/5708c4d7f6cc70ad7969 to your computer and use it in GitHub Desktop.
Save demmer/5708c4d7f6cc70ad7969 to your computer and use it in GitHub Desktop.
Combining Inputs with Juttle
// Prompt for a time duration and a threshold parameter
input duration: duration -label 'Time period';
input threshold: number -label 'Max response time (ms)' -default 500;
// Use these inputs to filter out only hosts that have experienced high response times
// during the specified time period.
input host: combobox -juttle "read -demo 'srch_cluster' -last :${duration}: name = 'response_ms' | filter value > ${threshold} | reduce by host"
-valueField 'host' -label 'Hosts with response time > ${threshold} ms';
// Once a host is selected, show the response time chart
read -demo 'srch_cluster' -last duration name='response_ms' host = #host
| @timechart -title 'Response time for ${host}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment