Skip to content

Instantly share code, notes, and snippets.

@djptek
Last active January 28, 2020 12:57
Show Gist options
  • Save djptek/e112aa32eee0243f62d0482b822bc27d to your computer and use it in GitHub Desktop.
Save djptek/e112aa32eee0243f62d0482b822bc27d to your computer and use it in GitHub Desktop.
On which days did we not meet our SLAs (95% of the requests took less than 500ms)?
# On which days did we not meet our SLAs (95% of the requests took less than 500ms)?
GET logs_server1/_search?filter_path=**.key_as_string
{
"size": 0,
"aggs": {
"logs_by_day": {
"date_histogram": {
"field": "@timestamp",
"calendar_interval": "day"
},
"aggs": {
"p95": {
"percentiles": {
"field": "runtime_ms",
"percents": [
95
]
}
},
"sla_filter": {
"bucket_selector": {
"buckets_path": {
"kpi": "p95[95.0]"
},
"script": "params.kpi > 500"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment