Problem with creating mapping template

Dear All,

I'm trying to create a mapping template like below:

PUT _template/documentum
{
  "index_patterns":"docu_*",
  "version": 1,
  "settings": {
"index.refresh_interval" : "5s"
  },
  "mapping": {
"doc": {
  "properties": {
    "@timestamp": {
      "type": "date"
    },
    "@version": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "docu": {
      "properties": {
        "session": {
          "properties": {
            "client_host": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "client_lib_ver": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "db_session_id": {
              "type": "text"
            },
            "dormancy_status": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "last_used": {
              "type": "date",
              "format": "dd/MM/YYYY HH:mm:ss"
            },
            "pid": {
              "type": "text"
            },
            "root_pid": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "root_start": {
              "type": "date",
              "format": "dd/MM/YYYY HH:mm:ss"
            },
            "session": {
              "type": "long"
            },
            "session_status": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "shutdown_flag": {
              "type": "text"
            },
            "start": {
              "type": "date",
              "format": "dd/MM/YYYY HH:mm:ss"
            },
            "transaction_status": {
              "type": "text"
            },
            "user_authentication": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "user_name": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        }
      }
    },
    "host": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "message": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "path": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "tags": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    }
  }
}
  }
}

The creating response is:

{
  "acknowledged": true
}

But when i'm trying to verify this template, it's seems not to be created properly:

{
  "documentum": {
    "order": 0,
    "version": 1,
    "index_patterns": [
      "docu_*"
    ],
    "settings": {
      "index": {
        "refresh_interval": "5s"
      }
    },
    "mappings": {},
    "aliases": {}
  }
}

do you know why.?

Many thanks for your feed back

Since your question is unrelated to Logstash I suggest you edit your post and move it to the Elasticsearch category.

@magnusbaeck, Ok it's done

Thank you

Does someone have an idea?

Index created successfully when I tried with PUT /sample instead of PUT _template/documentum
Verified with below query to confirm index created or not.
GET /_cat/indices?v
Index has been created with name sample.

when doing changes in template file , run curl -XPUT http://elasticsearchip:9200/_template/*?pretty -d @elasticsearch-template.json and restart the logtsah and create a new index . After creating the new index, you will see your changes.

@Arpit_Gulati, it works fine

Thank you

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