Hi Alexander,
Looks like date is getting index properly on Elastic search. CURL commands:
Create mapping:
curl -X PUT -H "Content-Type: application/json" -d '{"settings" : {"number_of_shards" : 3,"number_of_replicas" : 2},"mappings": {"dynamic":false,"properties": {"agent_utc_time": {"type": "date","format": "MM/dd/YYYY HH:mm:ss || MM/dd/YYYY || YYYY-MM-dd"},"agent_version": {"type": "keyword"},"application": {"type": "keyword"},"app_type": {"type": "keyword"},"event_id": {"type": "keyword"}}}}' -k https://:9200/dsdg_events2
Insert doc:
curl -X POST -H "Content-Type: application/json; charset=UTF-8" -d '{"agent_utc_time":"07/25/2019 00:00:00","agent_version":"7.5.1.0065","application":"outlook.exe","app_type":"Email","event_id":"CEB493CA-EC73-103C-9DC8-806E7F0EE8F7"}' -k https://:9200/dsdg_events2/_doc/CEB493CA-EC73-103C-9DC8-806E7F0EE8F7
Get the doc:
curl -X GET -k https://icam-es7-02:9200/dsdg_events2/_doc/CEB493CA-EC73-103C-9DC8-806E7F0EE8F7
{"_index":"dsdg_events2","_type":"_doc","_id":"CEB493CA-EC73-103C-9DC8-806E7F0EE8F7","_version":1,"_seq_no":0,"_primary_term":1,"found":true,"_source":{"agent_utc_time":"07/25/2019 00:00:00","agent_version":"7.5.1.0065","application":"outlook.exe","app_type":"Email","event_id":"CEB493CA-EC73-103C-9DC8-806E7F0EE8F7"}}
Here everything looks perfect but when I create index pattern on Kibana with the option "I don't want to use the Time Filter" selected on time filter field(attached screenshot):
And after if I search for the indexed doc on kibana I see the date as Jul 24 1970 as attached screen shot bellow
Even I create index pattern on Kibana using Time Filter "field name: agent_utc_time" when I search the document on Kibana it's showing wrong date year, day and time as attached screen shot below
Not sure if I am doing something wrong.
I am a Full Stack Java developer and new to Elastic search, I am sorry for simple and basic questions.
Thanks a lot!
Regards,
Dharmendra