Amazon ElasticSearch comes with the Kibana plugin installed to assist you in visualising and analysing your data. Because of the way the security model works, all calls into the Elastic Search cluster, including connecting to Kibana, must be signed with credentials. For us to connect to Kibana we need to either sign the request which the browser can’t do or we need to open it to our IP. Let’s do the latter and add our IP to the cluster security policy.


You can either use https://checkip.amazonaws.com/ to identify your IP, or use some other tools like curl ifconfig.me


*


If you refer back to the Java code in the IDE, in both the Producer and Consumer applications, there is a class called SaleItemTransaction which has these same fields in it. This class is used to serialise and deserialise the sales data into and out of the Kinesis stream, and further, into the ElasticSearch index as you can see here.
In this section, we will visualise and analyse the sales data using Kibana.


5
Your dataset will be different (due to the randomly-selected transactions and their details) but you will see a result similar to that shown here. In this example, Eyewear is the top moving product in the time period selected (Last 5 years).
5
As you can see, Kibana is a very powerful tool for analysing your data. Take some time to experiment with other graph types, fields and aggregations. You can save each visualisation you create, and then add them to a dashboard using the tools and icons in the Kibana web page.
If you need to clear the records, mappings and index from the ElasticSearch domain, you can issue the following from a terminal window:
curl -XDELETE https://<ElasticsearchEndpoint>/transactions -k
But replace with the ElasticsearchEndpoint value from Cloudformation - Outputs tab.
You will then need to re-create the mappings, by running the mappings command you ran earlier. You can then re-populate your data set by running the Consumer and Producer applications again.