Skip to content

Instantly share code, notes, and snippets.

@spalger
Created March 1, 2017 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spalger/16eb2597bd9add36b594e63e73aa4295 to your computer and use it in GitHub Desktop.
Save spalger/16eb2597bd9add36b594e63e73aa4295 to your computer and use it in GitHub Desktop.
DELETE metrics
PUT metricbeat
{
"mappings": {
"met": {
"properties": {
"system": {
"properties": {
"cpu": {
"properties": {
"idle": {
"properties": {
"pct": {
"scaling_factor": 1000,
"type": "scaled_float"
}
}
}
}
}
}
}
}
}
}
}
GET metricbeat/_mapping/field/*
POST metricbeat/met
{
"system": {
"cpu": {
"idle": {
"pct": 0.02
}
}
}
}
POST metricbeat/met
{
"system": {
"cpu": {
"idle": {
"pct": 0.03
}
}
}
}
POST metricbeat/met
{
"system": {
"cpu": {
"idle": {
"pct": 0.04
}
}
}
}
POST metricbeat/met
{
"system": {
"cpu": {
"idle": {
"pct": 0.05
}
}
}
}
POST metricbeat*/_search?size=0
{
"aggs": {
"1": {
"avg": {
"script": {
"inline": "doc['system.cpu.idle.pct'].value",
"lang": "painless"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment