Hi,
Please see this documentation on how to add nested data;
https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-mapping.html
I made this very crude test below and I can use the values of the attributes in Kibana. Note that I'm sure this is NOT the correct mapping you would want. This mapping doesn't add a date field so it doesn't allow you to create charts over time. It's just to show how to do the nested attributes.
Lee
curl -XDELETE 'http://elastic:notsecure@localhost:9200/test101'
curl --basic -XPOST 'http://elastic:notsecure@localhost:9200/test101' -d '{
"settings" : {
"number_of_shards" : 1
},
"mappings": {
"test": {
"properties": {
"attributes": {
"type": "nested",
"properties": {
"fuel": { "type": "string" },
"ip": { "type": "string" },
"alarm": { "type": "int" },
"io1": { "type": "int" }
}
}
}
}
}
}'
curl -XPUT 'http://elastic:notsecure@localhost:9200/test101/test/1' -d '{
"protocol": "noran",
"deviceid": 10,
"servertime": "2016-08-08T11:48:56.000Z",
"devicetime": "2016-08-08T11:48:53.000Z",
"fixtime": "2016-08-08T11:48:53.000Z",
"valid": true,
"latitude": 6.439499855041504,
"longitude": 3.456439971923828,
"altitude": 0,
"speed": 0,
"course": 237,
"address": null,
"attributes": {"alarm":128,"io1":0,"fuel":40,"ip":"197.210.225.60"},
"@version": "1",
"@timestamp": "2016-08-08T11:49:00.020Z"
}'
curl -XPUT 'http://elastic:notsecure@localhost:9200/test101/test/2' -d '{
"protocol": "noran",
"deviceid": 10,
"servertime": "2016-08-08T11:48:56.000Z",
"devicetime": "2016-08-08T11:48:53.000Z",
"fixtime": "2016-08-08T11:48:53.000Z",
"valid": true,
"latitude": 6.439499855041504,
"longitude": 3.456439971923828,
"altitude": 0,
"speed": 0,
"course": 237,
"address": null,
"attributes": {"alarm":121,"io1":0,"fuel":40,"ip":"197.210.225.60"},
"@version": "1",
"@timestamp": "2016-08-08T11:49:00.020Z"
}'
curl -XPUT 'http://elastic:notsecure@localhost:9200/test101/test/3' -d '{
"protocol": "noran",
"deviceid": 10,
"servertime": "2016-08-08T11:48:56.000Z",
"devicetime": "2016-08-08T11:48:53.000Z",
"fixtime": "2016-08-08T11:48:53.000Z",
"valid": true,
"latitude": 6.439499855041504,
"longitude": 3.456439971923828,
"altitude": 0,
"speed": 0,
"course": 237,
"address": null,
"attributes": {"alarm":321,"io1":0,"fuel":40,"ip":"197.210.225.60"},
"@version": "1",
"@timestamp": "2016-08-08T11:49:00.020Z"
}'