0
votes

I am trying to create an index in Elasticsearch (via developer console of Kibana). The index looks like this:

PUT _template/example_index
{
  "index_patterns": ["example_index*"],
  "settings": {
    "number_of_shards": 5,
    "number_of_replicas": 1
  },
  "mappings": {
    "track": {
      "properties": {
        "hash": {
          "type": "keyword"
        },
        "time": {
          "type": "date"
        }
      }
    }
  }
}

After that I put some data in Elasticsearch, and I create the index in Kibana via management -> index patterns -> create index; it will show the 'time' as a string field. It does not find any time fields at all.

The time in the added documents look like this: 1537185147182

3

3 Answers

1
votes

I too had same issue but solved with "ignore_malformed"

Below is mapping query:

PUT my_index
{
  "settings": {
    "index.mapping.ignore_malformed": true 
  },
  "mappings": {
    "my_type": {
      "properties": {
    "Size": {"type": "integer","ignore_malformed": false },
    "Creation_Time": {"type": "date", "format": "dd MMM yyyy HH:mm:ss"}
      }
    }
  }
}

Hope this will help.

0
votes

The created index and the index used to insert the data had a different name. Thus elasticsearch uses the dynamic way, and creates it how it likes.

Changing the index name fixed this.

0
votes

With me, I originally had an error in the mapping. I fixed it, I deleted and rebuilt the index. BUT, I did not delete the index pattern in kibana. You must delete and recreate the index pattern in kibana as well.