# How to customize the result of buckets

**URL:** <https://discuss.elastic.co/t/how-to-customize-the-result-of-buckets/104494>\
**Category:** Elasticsearch\
**Created:** [October 19, 2017, 6:16am UTC](https://discuss.elastic.co/t/how-to-customize-the-result-of-buckets/104494 "2017-10-19T06:16:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RomainXie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romainxie/32/22427_2.png) [@RomainXie](https://discuss.elastic.co/u/RomainXie)\
**Post date:** [October 19, 2017, 6:16am UTC](https://discuss.elastic.co/t/how-to-customize-the-result-of-buckets/104494/1 "2017-10-19T06:16:11Z")

</div>

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
    }
  }
]
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 16, 2017, 6:16am UTC](https://discuss.elastic.co/t/how-to-customize-the-result-of-buckets/104494/2 "2017-11-16T06:16:18Z")

</div>

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