# fluent-plugin-festival tutorial
## Install fluentd
```
gem install fluent-plugin-festival
```
fluentd 0.14.x will be installed automatically.
## Create a sample configuration file
Create a sample configuration file as follows. You need to change festival_portal_login_name and festival_portal_password to your account information.
```
% vi fluent.conf
---
@type stdout
---
```
## Start fluentd with debug mode
Start fluentd with debug mode as follows.
```
fluentd -c fluent.conf -vvv
```
Then, you can confirm the sensor values are output to your console.
You can try the other resources by browsing resources via FESTIVAL portal and change target resource URI to the ones listed in the resource information.
## Store data into Elasticsearch
About installation, please refer the following page.
https://www.elastic.co/downloads/elasticsearch
In the followings, how to store FESTIVAL platform data into Elasticsearch will be shown.
First of all, you need to create mapping in Elasticsearch. An Elasticsearch server is assumed to run in localhost.
```
vi iot_gateway-mapping.json
---
{
"iot_gateway": {
"properties": {
"timestamp": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
},
"resourceName": {
"type": "keyword"
},
"dataValue": {
"type": "double"
},
"location": {
"type": "geo_point"
}
}
}
}
---
curl -XPUT 'http://localhost:9200/festival'
curl -XPUT 'http://localhost:9200/festival/iot_gateway/_mapping' -d @iot_gateway-mapping.json
```
```
% vi fluent.conf
---
```