Hi there, total newcomer in the ElasticSearch concept. I've been reading the manuals for quite some time but I have managed minimal progress. Here is my scenario:
-
From a Raspberry Pi I collect some sensor data using Python and I group them in a JSON format. The complete JSON message is then sent via UDP to the ElasticSearch via FileBeat. This step is successful and with the option [tags] in filebeat.yml I'm able to filter easily my data in Kibana.
-
The JSON messages are a bit complex. They contain fields for timestamps, device ID's, message counters and a Payload list. This list includes then several measurements taken in a predefined time frame. Each measurement includes 2 arrays for storing HW statistics and analog measurements for the current. Below is an example with just 2 measurements:
{
"timestamp":"09-12-2019 14:06:10",
"device_id":"C1333",
"msg_counter":"000",
"payload":[
{
"cc":"01",
"timestamp":"09-12-2019 14:06:09",
"hw_stats":[
51.5,
2.4,
163.9
],
"current":[
87,
11.86,
6.66
]
},
{
"cc":"02",
"timestamp":"09-12-2019 14:06:09",
"hw_stats":[
51.5,
2.4,
163.7
],
"current":[
68,
12.20,
6.69
]
}
]
} -
My goal is to visualize each of the values in the "hw_stats" and "current" arrays real-time as the Rasberry uploads UDP data.
-
From the reading I've done I realize that I probably need to use nested data but still I'm not able to parse individual values.
-
Can someone suggest a work plan? I.e., i) is my JSON file formatted correctly? ii) do I need to change mappings to declare that "current" and "hw_stats" are arrays? iii) how do I really access individual data and visualize them? For the time being I just want to display the values in a nice graphical environment real-time but later on I plan to do analysis on them.