Hi,
I've created a index template in Kibana:
{
"properties": {
"date": {
"type": "date"
},
"formatDate": {
"type": "text"
},
"temp": {
"type": "long"
},
"busErr": {
"type": "long"
},
"deviceId": {
"type": "text"
},
"version": {
"type": "double"
},
"uptime": {
"type": "double"
},
"avgLoad": {
"type": "long"
},
"diskFree": {
"type": "long"
}
}
}
and I tried to ingest doc via NodeJS Application in this way:
var new_j = {"deviceId" : "XXX", "version": version, "uptime" : uptime, "busErr" : busErr, "avgLoad" : avgLoad, "temp" : temp, "diskFree" : diskFree, "formatDate" : formatDate(), "date" : new Date() };
client.index({
index: 'device_data_bridgenuzoo',
type: 'telemetry',
body: new_j
}), (err, resp, status) => {}
but I have this error:
UnhandledPromiseRejectionWarning: ResponseError: illegal_argument_exception
at onBody (/home/rob/elasticData/node_modules/@elastic/elasticsearch/lib/Transport.js:333:23)
Any idea? If I don't use the template, it works all without problem.
Thanks