April 2018
Intermediate to advanced
332 pages
8h 5m
English
Before we continue, we need to configure Elasticsearch to create a mapping. The timestamp that we generate in AWS IoT is of the type long. So, we are going to create a mapping field named datetime with the type date.
From a command line with cURL (https://curl.haxx.se/) present, execute the following command:
curl -XPUT 'https://search-pi3-dht11-dashboard-tcvfd4kqznae3or3urx52734wi.us-east-1.es.amazonaws.com/sensor-data?pretty' -H 'Content-Type: application/json' -d'
{
"mappings" : {
"dht11" : {
"properties" : {
"timestamp" : { "type" : "long", "copy_to": "datetime" },
"datetime" : {"type": "date", "store": true }
}
}
}
}
'
Replace the URL of Elasticsearch in the previous command as applicable. This will ...