Covid-19 @ Kibana
Let's analyze covid-19 outbreak in Elastic Stack!
Final Kibana Dashboard is as below:
- I finally choose to write a python script to crawl, filter, transform data from an api service into es. Because it's too hard to split one api response to many events in logstash.
- I setup es and kibana instance on top of elastic cloud service. It's super easy and awesome. Sass is wonderful.
- I build this demo dashboard on top of kibana.
- Python 3
- pip install requests,elasticsearch
This script can only download latest data now because the api server has stopped to support 'latest=0' parameter. https://lab.isaaclin.cn/nCoV/en
- Import covid-19 data
- Download covid-19.py
- Run following command
ES_URL=http://127.0.0.1:9200 ES_USERNAME=elastic ES_PASSWD=passwd python covid-19.py
- ES_URL is your es service endpoint
- ES_USERNAME is your es username and ignore this if you don't enable security feature
- ES_PASSWD is your es password and ignore this if you don't enable security feature
- covid-19.py will do following work.
- Check if there is covid-19-data index in your es instance.
- If no, it will create covid-19-data index with custom settings and mapping. Then it will download all historical covid-19 data and export to your es in covid-19-data index.
- If yes, it will only download latest covid-19 data.
- It will keep only one record per day for each country,province or city which will make our analysis job easier.
- Import kibana objects
- Start to play your own covid-19 data!
Feel free to open an issue or pull request!