Thanks Alexander for your response!
I have created mapping as-
https://:9200/dsdg_events1
Method: PUT
Header: "Content-Type: application/json"
Body:
{
"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"
},
...
...there are many other fields
}
}
}
Creating the index using java code here:
url = new URL("https://:9200/_bulk");
conn = (HttpsURLConnection) url.openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestProperty("Accept", "application/json");
conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
conn.setRequestMethod("POST");
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream(), "UTF-8");
writer.write(<>);
writer.close();
int responseCode = conn.getResponseCode();
Bulk Request Body:
{ "index" : { "_index" : "dsdg_events1", "_id" : "CEB493CA-EC73-103C-9DC8-806E7F0EE8F7" } }
{"agent_utc_time":"07/25/2019 00:00:00", "agent_version":"7.5.1","computer_type":"Windows","machine_domain_name":"partners", .....}
When I search the doc on Kibana : agent_utc_time Jul 24, 1970 @ 20:00:00.000
