Sitemap
Shreeharan Hareendran

Shreeharan Hareendran

Tech Enthusiast

ELK Stack

Introduction

The products we work daily rely and use multiple web servers and/or database servers. In such scenarios we don’t have a centralized logging system for analyzing or storing logs. During such situations analyzing, correlating logs and making educated decisions becomes an impossible task

For example a single exception which gets thrown in the middle of the system during a payment process can be devastating for both the end user and developers. This may lead a user viewing a blank page after clicking on the payment button. The appropriate remedy would be finding the issue and fixing it which falls on system administrators and developers..

But this means pulling logs from various servers and consolidating them through some manner before making a decision. That's how traditional system mangers treat logs. Set up one or more log servers receiving logs from servers, routers. Then using Unix commands such as — grep+awk,+sed+sort etc. Executing cronjobs periodically . After doing all these another burden is managing and analyzing the obtained paramount of data. They will in

This is where ELK stack comes for rescue. Users started to utile ELK for store logs, process and visualize them.The ELK stack is a collection of 3 open source products namely Elasticsearch, Logstash and Kibana

Basic Architecture of ELK

* Elasticsearch

Elastic Search is a robust search and analytics tool that stores data in a document-oriented data store. It is open source, meaning you can download, use and modify the program free of charge. The most popular usage of Elasticsearch today is Log Management. With document-oriented data storage, data is stored as structured JSON documents. Every field is indexed by default. Therefore, the search speed is incredible.

* Kibana

Kibana is an analytics and visualization platform which enables to easily visualize data from Elasticsearch Kibana is an Elasticsearch dashboard consist with line charts, pie charts and many others. Can plot the traffic to our website and show traffic in real time Can manage certain parts of elastic search and log stash such as authentication and authorization. Simply it is a web interface for the data stored in elastic search

* Logstash

Traditionally Logstash has been used to process logs from applications and send them to Elasticsearch. It is a data processing pipeline. The data Logstash receives will be handled as events and it can be of any kind

Ex — log file entries, ecommerce orders, chat messages

Log stash pipeline consist of 3 stages/plugins

Get Shreeharan Hareendran’s stories in your inbox

Join Medium for free to get updates from this writer.

Inputs, filters and outputs

Inputs can be from Kafka ques, http messages, relational DATABASE. These are processed by log stash and sent to one or more destinations. Such as elastic search, Kafka queue, Emil message.

So, in a nutshell Logstash receives events from one or more inputs processes them and sends them to one more stash

* Beats

Beats is a collection of so-called data shippers. They are light weight agents with a single purpose that you install on servers, which then sends data to Logstash or elastic search

Types of beats

File beat

collecting log files and sending them to Logstash or elastic search.File beat ships with modules for common logs such as ngnix the apache web server and MySQL.Can be used to collect access logs and error logs

Metric beat

collects system level or service metrics such as CPU and memory usage of OS and any other service

Various methods in which beats, Logstash, Elasticsearch and Kibana can be utilized

References

https://www.elastic.co/what-is/elk-stack

https://towardsdatascience.com/an-overview-on-elasticsearch-and-its-usage-e26df1d1d24a

https://www.youtube.com/watch?v=Hqn5p67uev4