mattfield11/mqtt-elasticSearch

Issue importing JSON using script

Closed this issue · 3 comments

Hi, I followed your tutorial on Smart Factory, however I can't get the dataString to divide the fields into individual fields.

Example payload:

 {
"device":"368640",
"deviceType":"Sigfox-Tracker",
"version":3,
"time":"Tue Aug 21 2018 02:33:05 GMT+0000 (UTC)",
"rssi":"-120.00",
"battery":3.28,
"temp":20.87,
"soil":1915,
"xAxis":59,
"yAxis":-38,
"zAxis":994
}

untitled-1

Here is the data visualised in Kibana. The topmost is using your scrip, and the second is if I manually add data to make the mapping for the index. Any help would be greatly appreciated.

I managed to correct it after modifying the script and adding an ingest pipeline. Had to change the date back to epoch for Kibana to recognise it as a timestamp. Thank you for the script though Matt, I wouldn't of made it this far without you.