I have to store date in the index as date format. My mappings are
PUT logstash_testing/logs/_mapping
{
"properties": {
"ActualDateTime": {
"type": "keyword"
},
"Priority": {
"type": "keyword"
},
"FailureReason": {
"type": "keyword"
},
"MessageSubmissionTime": {
"type": "date",
"format": [ "EEE MMM dd HH:mm:ss.SSS yyyy" ]
},
"MessageDeliveryTime": {
"type": "date",
"format": [ "EEE MMM dd HH:mm:ss.SSS yyyy" ]
},
"RecordType": {
"type": "keyword"
}
}
}
As per the documents I refereed the Joda time and defined my mapping like above
Sample data:
POST logstash_testing/logs/1
{
"ActualDateTime": "test",
"Priority": "Normal",
"FailureReason": "Sequence Number is missing",
"MessageSubmissionTime": "Fri Mar 17 18:24:43.172 2017",
"MessageDeliveryTime": "Fri Mar 17 18:24:43.172 2017",
"RecordType": "DeliveryReceipt"
}
But its throwing the error while indexing
"reason": "Invalid format: \"Fri Mar 17 18:24:43.075 2017\""
Can you help how to put mappings for this type of dates????