How to customize the result of buckets


(Romain Xie) #1

Hi, all

We got the query result like followed. But we want to:

  • remove the first item, because the first is useless after derivative aggs;
  • remove some field in each result item, etc: avg-bytes, which is intermediate;

Could do it?
Thank you

Snippet of the result:

"buckets": [
  {
    "key_as_string": "2017-10-19T06:03:00.000Z",
    "key": 1508392980000,
    "doc_count": 1,
    "avg-drops": {
      "value": 0
    },
    "avg-bytes": {
      "value": 145288833014517
    },
    "avg-errors": {
      "value": 4305279
    },
    "avg-packages": {
      "value": 503763209945
    }
  },
  {
    "key_as_string": "2017-10-19T06:04:00.000Z",
    "key": 1508393040000,
    "doc_count": 1,
    "avg-drops": {
      "value": 0
    },
    "avg-bytes": {
      "value": 145290646880875
    },
    "avg-errors": {
      "value": 4305279
    },
    "avg-packages": {
      "value": 503766394298
    },
    "bytes": {
      "value": 1813866358
    },
    "packages": {
      "value": 3184353
    },
    "errors": {
      "value": 0
    },
    "dropped": {
      "value": 0
    }
  },
  {
    "key_as_string": "2017-10-19T06:05:00.000Z",
    "key": 1508393100000,
    "doc_count": 1,
    "avg-drops": {
      "value": 0
    },
    "avg-bytes": {
      "value": 145292209026350
    },
    "avg-errors": {
      "value": 4305279
    },
    "avg-packages": {
      "value": 503769276391
    },
    "bytes": {
      "value": 1562145475
    },
    "packages": {
      "value": 2882093
    },
    "errors": {
      "value": 0
    },
    "dropped": {
      "value": 0
    }
  },
  {
    "key_as_string": "2017-10-19T06:06:00.000Z",
    "key": 1508393160000,
    "doc_count": 1,
    "avg-drops": {
      "value": 0
    },
    "avg-bytes": {
      "value": 145293849280911
    },
    "avg-errors": {
      "value": 4305279
    },
    "avg-packages": {
      "value": 503772374290
    },
    "bytes": {
      "value": 1640254561
    },
    "packages": {
      "value": 3097899
    },
    "errors": {
      "value": 0
    },
    "dropped": {
      "value": 0
    }
  }
]

(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.