I am trying to bulk upload documents into elasticsearch(6.3) using logstash (6.3.1). One of the fields in the document in date. Below is my mapping type `
{
"mappings": {
"users" : {
"properties" : {
"name" : { "type" : "text" },
"location" : { "type" : "geo_point"},
"date": {
"type": "date",
"format": "yyyy-MM-dd"
}
}
}
}
If there is no date available then I set it as null.
Ex csv upload doc
John, Seattle, null
During the upload, logstash reads the value for date as "null" (null with quotes) and the upload to elasticsearch fails because its doesn't accept "null" as a valid input to date.
My question is how to let elasticsearch accept null values (null without quotes) for date when uploading from logstash?
if [date] =~ /null/ { mutate { remove_field => [ "date" ] } }- baudsp