前言:本文源于天天是霧霾新聞,我想利用kibana畫(huà)一下一線城市霧霾圖,希望對(duì)想利用經(jīng)緯度在kibana繪圖和獲取日志本身時(shí)間繪圖的同學(xué)有所幫助。有什么疑問(wèn)或者糾錯(cuò),可以給我發(fā)郵件
一、數(shù)據(jù)準(zhǔn)備
為了方便起見(jiàn),我模擬臆造了json格式的數(shù)據(jù)
{"timestamp":"2017-01-13T13:13:32.2516955+08:00","deviceId":"myFirstDevice","windSpeed":17,"haze":284,"city":"Beijing","lat":33.9402,"lon":116.40739}
模擬數(shù)據(jù)我用的是c#,大概如下:
static void SendingRandomMessages() { //var eventHubClient = EventHubClient.CreateFromConnectionString(connectionString, eventHubName); int len = 4; string[] citys = { "Beijing", "Shangjhai", "Guangzhou", "Shenzhen" }; int[] avgWindSpeed = { 10, 16, 5, 7 }; int[] avgWindSpeed1 = { 10, 16, 5, 7 }; &nbs