I am trying to insert data to ES using logstash template. Data is inserting fine but I have an issue with the data type. I have set datatype date for a particular data (in example reviewId), but it is also letting insert string datatype. I want to restrict this kind of insertion.
here is my template
{
"index_patterns": ["my_index_*"],
"settings": {
"index": {
"number_of_shards": "2",
"number_of_replicas": "1"
}
},
"mappings": {
"doc":{
"dynamic": "false",
"properties": {
"reviewId": {
"type": "date"
}
}
}
},
"aliases": {}
}
my data
{"reviewId":"hello i am string","reviewer":{"profilePhotoUrl":bla bla","displayName":"Afrid Khan"},"starRating":"FIVE","comment":"Good working environment","createTime":"2018-11-21T11:38:54.366207Z","updateTime":"2018-11-21T11:39:11.527644Z","name":"bla bla"}
field reviewId is set to be a date type, but it is still inserting into ES.
Not only for a date, but I also want to restrict insertion if data does not match with correspondent type. How to prevent that ?
Thanks n Regards
@inandi