This is a "How To" on generating a live heat-map of tweets sent within the U.S.A using the ELK Stack(Elasticsearch,Logstash,Kibana) and NodeJS. See below for the screenshot of the final product of this guide.
/Documents
|-- /elasticsearch
| | -- /bin
| | -- elasticsearch.bat
|-- /kibana
| | -- /bin
| | -- kibana.bat
|-- /logstash
| | -- /bin
| | -- logstash.bat
|-- /filebeats
| | -- filebeat.exe
| | -- filebeat.yml
|
|-- /TwitterHeatmaps
| | -- server.js
| | -- nodetwit.conf
| | -- filebeat.yml
-
Clone this Repo!! -> https://github.com/mkbru/TwitterHeatmaps.git
-
Replace the ./filebeat->filebeat.yml with filebeat.yml
consumer_key: '',
consumer_secret: '',
access_token: '',
access_token_secret: '',
timeout_ms: 60*1000, // optional HTTP request timeout to apply to all requests.
})
-
- C:\:
.\Documents\elasticsearch-5.6.2\bin\elasticsearch
- C:\:
.\Documents\kibana-5.6.3-windows-x86\bin\kibana.bat
- C:\:
.\Documents\logstash-5.6.3\bin\logstash -f .\Documents\TwitterHeatmaps\twitter_heatmaps_logstash.conf
- C:\:
.\Documents\filebeat-5.6.4-windows-x86_64\filebeat.exe -e -c .\Documents\filebeat-5.6.4-windows-x86_64\filebeat.yml
- C:\:
-
Go to
<localhost:5601>
in your browser -
Click "Management"
-
Enter 'twittermaps' as the index pattern
-
Click "Create"
- Click "Dev Tools"
- Paste the JSON object in the console,highlight the code,click "Play"
PUT twittermaps
{
"mappings": {
"locality": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
- Under "Available Fields" hover over "location" and click "Add"
- Once "location" is added to "Selected Fields" click "Visualize" (We are almost there!!!)
- In the "Options" select "Map Type" heatmap
- Click "Play", you should see a heatmap appear
- You can save this visualization and add it to a Dashboard.
- Your visualization should look like the one below: