Elasticsearch data storage design


(Ans76) #1

I have sensor data from devices. looks like:
[status:1,temperature:20,date:20160101]
[status:1,temperature:21,date:20160101]
[status:1,temperature:21,date:20160101]
[status:1,temperature:21,date:20160101]
[status:2,temperature:5,date:20160101]
[status:2,temperature:5,date:20160101]
[status:2,temperature:5,date:20160101]
[status:1,temperature:21,date:20160101]
[status:1,temperature:21,date:20160101]

also there is timestamp field in each data, I prepare to storage them to elasticsearch, I have 2 requirements

  1. query temperature list in different status and do the pagination
    [status:1,temperature[20,21,21,21]]
    [status:2,temperature[5,5,5]]
    [status:1,temperature[21,21]]

  2. query average temperature per day avgTemperature(date)

is there any proper way to storage these data in es or need to change the data structure? pls provide some advices about this case.


(Mark Walkom) #2

Store them as you have them, just make sure you map the date and time fields correctly.

Then you can run various aggregations to get what you want. The best place to start with that is in Kibana.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.