# Can't write data to elasticsearch (cannot be changed from type \[date\] to \[text)

**URL:** <https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062>\
**Category:** Elasticsearch\
**Created:** [April 15, 2023, 9:08am UTC](https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062 "2023-04-15T09:08:09Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![Indeed2000](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@Indeed2000](https://discuss.elastic.co/u/Indeed2000)\
**Post date:** [April 16, 2023, 7:09pm UTC](https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062/21 "2023-04-16T19:09:09Z")

</div>

@Christian_Dahlqvist execlty i do the same thing, keep host and remove others it drastically reduce size of index.

Thanks,

---

<div class="post-metadata">

**Author:** ![Indeed2000](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@Indeed2000](https://discuss.elastic.co/u/Indeed2000)\
**Post date:** [April 29, 2023, 2:59pm UTC](https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062/22 "2023-04-29T14:59:19Z")

</div>

@Christian_Dahlqvist another issue is some fields types like “hostname” are text, and not aggregatable!

Need to show a timechart on kibana, when i set e.g average “system load” field as vertical it show on chat, but when i add “hostname” as breakdown not show anything!

Now question is what is the best way to resolve this issue? Change field type? Change mapping field, change logstash config file, ...?

Any idea?  
Thanks

---

<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:** [May 27, 2023, 3:00pm UTC](https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062/23 "2023-05-27T15:00:18Z")

</div>

Closed on May 27, 2023, 3:00pm UTC

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

[Previous page](https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062.md?page=1)
