# Logstash move subfield to top field

**URL:** <https://discuss.elastic.co/t/logstash-move-subfield-to-top-field/244309>\
**Category:** Logstash\
**Created:** [August 9, 2020, 3:59pm UTC](https://discuss.elastic.co/t/logstash-move-subfield-to-top-field/244309 "2020-08-09T15:59:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [August 9, 2020, 4:03pm UTC](https://discuss.elastic.co/t/logstash-move-subfield-to-top-field/244309/2 "2020-08-09T16:03:51Z")

</div>

Something very similar to [this](https://discuss.elastic.co/t/how-to-dynamically-move-nested-key-value-to-root-level/180006/2), except that instead of "doc" it would be "[City][Data]" and instead of using just k in the event.set it would be "[City][#{k}]".

---

_[View the full topic](https://discuss.elastic.co/t/logstash-move-subfield-to-top-field/244309)._
