Skip to content

Instantly share code, notes, and snippets.

@rokcarl
Created October 28, 2020 07:27
Show Gist options
  • Save rokcarl/6ccd0db96d5bbce37125cdf60c7029a7 to your computer and use it in GitHub Desktop.
Save rokcarl/6ccd0db96d5bbce37125cdf60c7029a7 to your computer and use it in GitHub Desktop.
PUT _rollup/job/stat_rollups
{
"index_pattern": "stats-*",
"rollup_index": "stat_rollups",
"cron": "0 */5 * * * ?",
"page_size": 1000,
"groups": {
"date_histogram": {
"field": "timestamp",
"fixed_interval": "60m",
"delay": "10m"
},
"terms": {
"fields": [
"app",
"route.profile",
"matrix.profile",
"customer"
]
}
},
"metrics": [
{
"field": "credits",
"metrics": ["sum", "avg"]
},
{
"field": "async_waiting",
"metrics": ["max", "avg"]
},
{
"field": "async_took",
"metrics": ["max", "avg"]
},
{
"field": "took",
"metrics": ["max", "avg"]
},
{
"field": "route.points_count",
"metrics": ["max", "sum", "avg"]
}
]
}
POST _rollup/job/stat_rollups/_start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment