# Flattened fields vs subobjects=false

**URL:** <https://discuss.elastic.co/t/flattened-fields-vs-subobjects-false/322631>\
**Category:** Elasticsearch\
**Created:** [January 6, 2023, 4:45pm UTC](https://discuss.elastic.co/t/flattened-fields-vs-subobjects-false/322631 "2023-01-06T16:45:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdentino](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bdentino/32/115664_2.png) [@bdentino](https://discuss.elastic.co/u/bdentino)\
**Post date:** [January 6, 2023, 4:45pm UTC](https://discuss.elastic.co/t/flattened-fields-vs-subobjects-false/322631/1 "2023-01-06T16:45:43Z")

</div>

Hi everyone,

Can someone help me understand the fundamental differences between a 'flattened' field type and an 'object' field type with subobjects=false? AIUI, everything under a 'flattened' object is indexed as a keyword whereas perhaps objects with no field subobjects support numeric, etc types in the subkeys, plus it appears keys in a flattened field are more limited with respect to the types of queries they support. There may also be a difference in terms of tooling support for each type (e.g. Kibana dashboards & rules)?

For context, right now I am trying to solve an ingest problem where we have a lot of dynamic labels in log messages, some of which contain dots leading to mapping conflicts (e.g. `label.x="abc"` and `label.x.y="xyz"`). From what I can gather, making `labels` a flattened field should do the trick but in my research I came across the new subobjects flag in ES8 which also seems like it would work. I'm having a hard time wrapping my head around exactly when it makes sense to use one vs the other.

---

<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:** [February 3, 2023, 4:46pm UTC](https://discuss.elastic.co/t/flattened-fields-vs-subobjects-false/322631/2 "2023-02-03T16:46:14Z")

</div>

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