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. )
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
}```
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.