Jump toUpdate content

How to use the logging Kickstart

Reviewed on 02 June 2021Published on 01 September 2019

The logging Kickstart provides a database and a dashboard to store and visualize log messages transmitted through your IoT Hub.

It will setup and configure the following software on a Scaleway Instance:

  • ElasticSearch: a document database tailored for log storage
  • Kibana: a powerful log visualization dashboard
  • Bridge: a very simple, Scaleway-made, MQTT client to store messages in ElasticSearch
Requirements:

How to create the Logging Kickstart

  1. Create a new logging purpose Kickstart from the Scaleway console.

  2. Select the IoT Hub and device to use with the Kickstart.

    Important:

    Currently only devices supporting insecure connections are allowed for this IoT Kickstart.

  3. Choose the geographical region to deploy your Kickstart.

  4. Set a password for the Kickstart’s dashboard.

  5. Click Create a Kickstart to launch the installation of the software stack.

Note:

The kickstart setup process will insert a first log item in the database to make sure it is up and running.

How to use the Logging Kickstart

The bridge will connect to your IoT Hub and subscribe to # (all topics, more information about MQTT topics here. Any valid message published on your IoT Hub will be stored as a document in the ElasticSearch database.

If the message payload is a UTF-8 encoded string, there are 3 possibilities:

  • payload is a number: this number will show up in a value field of the document
  • payload is a JSON encoded string: the first order JSON fields will be stored in the document
  • payload is any other string: this string will show up in a payload field of the document The bridge also adds a topic and a timestamp field to any document.
  1. Click IoT Hub in the IoT Station section of the side menu. The list of your IoT Hubs displays.

  2. Click the name of the IoT Hub you want to configure. The hub’s overview page displays.

  3. Click Devices to display the configuration of the device.

  4. Click Add devices in the devices tab. The Create a Device wizard displays.

  5. Enter a name for the device and allow insecure connections.

  6. Click Add a Device to your Hub. The details of the device display. Take a note of the Device ID:

  7. Open a terminal window on your local computer and type the following command:

    mosquitto_pub -h iot.fr-par.scw.cloud -i <device id> -t home/bedroom/temperature -m 19.4
    Note:

    The Endpoint iot-fr-par.scw.cloud may vary, you find your endpoint on the Hub’s network page.

    The command above contains the following elements:

    • -h: The endpoint or host of your IoT Hub. You require it to communiciate with your hub.
    • -i: The device ID of your device. You can retrieve it from the Devices section of your hub.
    • -t: The thread to send your meesage to.
    • -m: The message containing the information you want to transmit.
  8. Open a web browser and go to your Kickstarts dashboard (Kibana) available at http://<your_kickstart_instance_ip>. Login using the user admin and the password set during the Kickstart creation.

  9. Click «See more Icon», then Discover. The discover page displays. You should see an item matching the message you just sent.

For more information about Kibana features, see the official documentation.

See Also