Visualize Real Time Twitter Sentiment Analysis Elastic Search and Kibana
Before you start following this tutorial, make sure you have read earlier blog about how to do real time sentiment analysis using spark. Now, if you have followed the blog you will see at the end of code we are pushing data to elastic search.
Make sure to import following libraries.
Create a visualization in kibana
Now you can change the settings in newly created kibana dashboard to make it auto refresh every 5 seconds.
Start the streaming and your graph will get updated in real time.
temp.saveJsonToEs("eclipse/test") // Writing to ElasticSearchPrerequisites:
- Install Elasticsearch ( open source )
- Install Kibana ( open source)
Make sure to import following libraries.
import org.elasticsearch.spark._We have two ways to push data to elastic search:
import org.elasticsearch.spark.streaming._
- In JSON format
- In Map RDD format
Create a visualization in kibana
- Start elasticsearch and kibana.
- Go to kibana dashboard on default port 5601.
- Click on visualization tab and now click on vertical bar.
- Keep the setting as shown in the image.
- Go to dashboard and create a new dashboard.
- click on add to add a new visualization on dashboard.
Now you can change the settings in newly created kibana dashboard to make it auto refresh every 5 seconds.
Start the streaming and your graph will get updated in real time.

Comments
Post a Comment