# Getting sum of a field in xml

**URL:** <https://discuss.elastic.co/t/getting-sum-of-a-field-in-xml/251657>\
**Category:** Logstash\
**Created:** [October 10, 2020, 8:45pm UTC](https://discuss.elastic.co/t/getting-sum-of-a-field-in-xml/251657 "2020-10-10T20:45:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 11, 2020, 9:19pm UTC](https://discuss.elastic.co/t/getting-sum-of-a-field-in-xml/251657/4 "2020-10-11T21:19:58Z")

</div>

To move sub-fields to the top level you can use code like [this](https://discuss.elastic.co/t/how-to-dynamically-move-nested-key-value-to-root-level/180006/2).

---

_[View the full topic](https://discuss.elastic.co/t/getting-sum-of-a-field-in-xml/251657)._
