# Value ( 1.0. ) ( Notice the last dot after 0 ) getting stored as type Date in Elastic search

**URL:** https://discuss.elastic.co/t/value-1-0-notice-the-last-dot-after-0-getting-stored-as-type-date-in-elastic-search/309411
**Category:** Elasticsearch
**Created:** [July 12, 2022, 11:16am UTC](https://discuss.elastic.co/t/value-1-0-notice-the-last-dot-after-0-getting-stored-as-type-date-in-elastic-search/309411 "2022-07-12T11:16:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ajitw](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@ajitw](https://discuss.elastic.co/u/ajitw)
#### Post date: [July 12, 2022, 11:16am UTC](https://discuss.elastic.co/t/value-1-0-notice-the-last-dot-after-0-getting-stored-as-type-date-in-elastic-search/309411/1 "2022-07-12T11:16:33Z")

</div>

We store logs data in Elasticsearch we have added functionality which makes the JSON logs stored in Elasticsearch as seperate fields.  
In one of the logs appVersion value was coming as - ( 1.0. ) - Notice the last dot after 0  
for this value Elasticsearch interpreted as date as stored the value as - 'Jan 1, 1970 @ 05:30:00.001'

But if the appVersion value is ( 1.0.0 ) - Notice no dot at the end , then the value is stored properly

What should we do for this problem  
appVersion getting stored as date when the appVersion value is ( 1.0. )

 ![Screenshot 2022-07-12 at 4.44.26 PM](https://us1.discourse-cdn.com/elastic/original/3X/3/d/3d223e01d4bcc59cc23ab4d478ce226d6df50e30.png)

appVersion getting stored as version properly when the appVersion value is ( 1.0.0 )

 ![Screenshot 2022-07-12 at 4.44.15 PM](https://us1.discourse-cdn.com/elastic/original/3X/0/4/04a5401c8dedfd37f2e1de73a9b8965728145fee.png)

---

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [July 13, 2022, 2:09pm UTC](https://discuss.elastic.co/t/value-1-0-notice-the-last-dot-after-0-getting-stored-as-type-date-in-elastic-search/309411/2 "2022-07-13T14:09:46Z")

</div>

Are you using dynamic mappings? Is it difficult to set the field mappings as text before indexing documents?

---

<div class="post-metadata">

### Author: ![ajitw](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@ajitw](https://discuss.elastic.co/u/ajitw)
#### Post date: [July 14, 2022, 3:44am UTC](https://discuss.elastic.co/t/value-1-0-notice-the-last-dot-after-0-getting-stored-as-type-date-in-elastic-search/309411/3 "2022-07-14T03:44:21Z")

</div>

Yes using dynamic mapping.  
Yeah actually to set mapping before indexing the documents, I don't know what fields it would be as we are consuming the calls and storing this to Elasticsearch.

As it is giving error for date, I am thinking of setting below mappings for date format  
`PUT /qa-valid-date-format  
{  
"mappings": {  
"dynamic\_date\_formats": ["yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"]  
}  
}

which is working for the sample index.  
but the indexes what are already created I tried setting mapping I am getting below error

{  
"error" : {  
"root\_cause" : [  
{  
"type" : "cluster\_block\_exception",  
"reason" : "index [qa-2022-07-01] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-02] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-03] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-04] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-05] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-06] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-06-30] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"  
}  
],  
"type" : "cluster\_block\_exception",  
"reason" : "index [qa-2022-07-01] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-02] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-03] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-04] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-05] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-07-06] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];index [qa-2022-06-30] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"  
},  
"status" : 429  
}```

---

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [July 14, 2022, 4:41am UTC](https://discuss.elastic.co/t/value-1-0-notice-the-last-dot-after-0-getting-stored-as-type-date-in-elastic-search/309411/4 "2022-07-14T04:41:22Z")

</div>

Using dynamic\_date\_formats or [dynamic templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html) are good for you.

You have to [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html) indices to change existing mappings. [It could not be updated within existing index.](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html#updating-field-mappings)

---

<div class="post-metadata">

### Author: ![ajitw](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@ajitw](https://discuss.elastic.co/u/ajitw)
#### Post date: [July 14, 2022, 3:43pm UTC](https://discuss.elastic.co/t/value-1-0-notice-the-last-dot-after-0-getting-stored-as-type-date-in-elastic-search/309411/5 "2022-07-14T15:43:06Z")

</div>

Yes that is solution to reIndex that data, but new data is still coming with **appVersion:1.0.**  
can you please list down step how can I have achieve it.

---

<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: [August 11, 2022, 3:43pm UTC](https://discuss.elastic.co/t/value-1-0-notice-the-last-dot-after-0-getting-stored-as-type-date-in-elastic-search/309411/6 "2022-08-11T15:43:37Z")

</div>

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