SlideShare a Scribd company logo
Kibana + ElasticSearch + LogStash
By Dmitriy Mustafin
JavaMeetup
handle Log messages on Prod servers
My experience
- I started with machine code and punched cards. I used to write on
Assembler, then on C and Pascal, С++, Delphi, C#, Javascript, and
some other scripting languages. Now I mostly write on Java, and I’m
pretty much happy with that.
- DOS (it was a wonderful to have 21h interrupt), OS/2, QNX,
Windows (my favorite so far), Linux (and Yocto as well), MacOS/iOS.
- I studied at university but I still haven't defended my thesis (and I'm
not planning on doing this anytime soon). I keep learning new things
during my work.
- I was writing, designing, engineering, managing and solving
problems.
- Married, children, cat.
HYS Enterprise is a Dutch software
development company with more than
200 talented engineers
from all over the world
hys-enterprise.com
Agenda
● What is log and what’s this for?
● How can we do log totally senseless?
● Logging levels or how not to drown in gigs of data
● Most popular logging processors
● Elastic Stack as a result of smoking in the Netherlands
● This beautiful Kibana
● This nimble and gluttonous ElasticSearch
● This terrifying LogStash
● LogStash: real-life example (or even live demo)
● How can we avoid pitfalls of LogStash?
● ElasticBeats or “What else do you want from me?”
What is log and what’s
this for?
In computing, a log file is a file that records either events
that occur in an operating system or other software runs,
or messages between different users of a communication
software.
Logging is the act of keeping a log. In the simplest case,
messages are written to a single log file.
Wikipedia
How can we do log totally senseless?
Harmful advices:
● Do not use log-files!
● Never put datetime, log level, process id, thread id, specific entity grouping, message
itself into log message
● Never make file rolling!
● 15 GB log-file is ok
● 150+ GB log-file is perfect!
● Never zip old files
● Keep log files no more than 1 day (max 2 days)
● Nobody should to know about log-files!
● Never analyze log-files!
● Never put live data on big screen in developers room!
Logging levels or
how not to drown in gigs of data
+ custom log levels
Standard log levels built-in to Log4J 2 ™ intLevel
OFF 0
FATAL 100
ERROR 200
WARN 300
INFO 400
DEBUG 500
TRACE 600
ALL Int max
Most popular logging processors
Top 10 (?) Log Analysis Tools by KeyCDN:
1. Loggly
2. Logentries
3. GoAccess
4. logz.io
5. Graylog
6. Splunk
7. Logmatic.io
8. Logstash
9. Sumo Logic
10. Papertrail
11. Fluentd
Elastic Stack as a result of smoking in
the Netherlands
● Original author: Shay Banon
● Stable release: 6.4.2 / October 2, 2018 *
● Repository: github.com/elastic/elasticsearch
● Written in Java
● Operating system: Cross-platform
● Type: Search and index
● License: Apache License 2.0
● Website: www.elastic.co/products/elasticsearch
Elastic Stack as a result of smoking in
the Netherlands - cont.
● Shay Banon (Compass) 2004 - Downloads: 0
● June 2012 - Downloads: <16,000
● July 2015 - Downloads: 36,431,145
● October 2015 - Downloads: 44,378,846
● October 2016 - Downloads: 91,183,928
● May 2017 - Downloads: 137,715,884
● October 2017 - Downloads: 192,865,831
● February 2018 - Downloads: 267,972,265
18 offices in Europe, America, Asia
This beautiful Kibana
Kibana lets you visualize your Elasticsearch data and navigate the Elastic Stack, so you can
do anything from learning why you're getting paged at 2:00 a.m. to understanding the
impact rain might have on your quarterly numbers.
https://www.elastic.co/products/kibana
● Web UI
● Useful search and filtering
● Visualisations
● Dashboards
● Compute fields
Kibana+ElasticSearch+LogStash to handle Log messages on Prod servers
Kibana+ElasticSearch+LogStash to handle Log messages on Prod servers
This nimble and gluttonous
ElasticSearch
ElasticSearch is a distributed, RESTful search and analytics engine capable of solving a growing
number of use cases. As the heart of the Elastic Stack, it centrally stores your data so you can discover
the expected and uncover the unexpected.
https://www.elastic.co/products/elasticsearc
h
● ElasticSearch Is Fast. Really, Really Fast.
● Run It on Your Laptop or Hundreds of Servers with Petabytes of Data.
● Interact with ElasticSearch in the Programming Language You Choose.
● Extend ElasticSearch.
This terrifying LogStash
Logstash is an open source, server-side data processing pipeline that ingests data from a multitude of
sources simultaneously, transforms it, and then sends it to your favorite “stash”.
https://www.elastic.co/products/logstas
h
● Takes 1GB or RAM (Java!)
● Parsing and computing @ onboard machine
● Network consumption is tens of MBps
● Looooong start (Java!)
● GrOk and RegExp
● Not easy to debug the script
Classic solution:
Prod server(s) Kibana server(s)
Our Service
Log file(s)
LogStash
ElasticSearch
Indexes
Kibana
How it works
LogStash: real-life example (live demo)
● Log file of Spring Boot application
● Log4j2 with MDC for entity grouping
● Sample GrOk config file (input, filter, output)
○ Discussing config file
○ Example of RegExing
○ Example of debugging GrOk matcher
● Start Elastic Stack on Windows machine
● Scan sample log-files
● Magic of Kibana
○ Discovery
○ Visualisation
○ Dashboard
How can we avoid
pitfalls of LogStash?
● Takes 1GB or RAM (Java!) ⇒ Rewrite it on Go
● Parsing and computing @ onboard machine ⇒ Move to other machine
● Network consumption is tens of MBps ⇒ Zip data (?)
● Looooong start (Java!) ⇒ Rewrite it on Go
● GrOk and RegExp ⇒ Life is pain...
● Not easy to debug the script ⇒ Keep calm and heavy breathing...
Prod server(s) Kibana server(s)
Our Service
Log file(s)
LogStash
ElasticSearch
Indexes
Kibana
FileBeat
Beat solution:
How it works now
ElasticBeats or
“What else do you want from me?”
Beats (Lightweight Data Shippers) is the platform for single-purpose data shippers. They install as
lightweight agents and send data from hundreds or thousands of machines to Logstash or
Elasticsearch.
https://www.elastic.co/products/beats
● Filebeat, Metricbeat, Packetbeat, Winlogbeat, Auditbeat, Heartbeat, etc…
● Tens of community beats...
● … and custom Beat constructor
Useful links
● About https://en.wikipedia.org/wiki/Kibana
● https://www.elastic.co/products/kibana
● https://www.elastic.co/products/logstash
● https://www.elastic.co/products/elasticsearch
● Easy install-config manual: http://knes1.github.io/blog/2015/2015-08-16-manage-spring-boot-logs-with-
elasticsearch-kibana-and-logstash.html
● Default patterns for Grok parser: https://github.com/elastic/logstash/blob/v1.4.2/patterns/grok-patterns
● Web-site to test regular expressions: https://regex101.com/
● Web-site to test Grok expression: http://grokconstructor.appspot.com
● Search how-to: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/query-dsl-query-string-
query.html#query-string-syntax
Thank you for your
attention!
Any Questions?

More Related Content

PDF
Go frugal with web services
PDF
Scaling ELK Stack - DevOpsDays Singapore
ODP
Monitoring with ElasticSearch
PDF
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
PPTX
Mongodb open data day 2014
PPTX
Open Source Monitoring Tools
PDF
Thorny path to the Large-Scale Graph Processing (Highload++, 2014)
PPTX
Conceptos básicos. Seminario web 6: Despliegue de producción
Go frugal with web services
Scaling ELK Stack - DevOpsDays Singapore
Monitoring with ElasticSearch
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Mongodb open data day 2014
Open Source Monitoring Tools
Thorny path to the Large-Scale Graph Processing (Highload++, 2014)
Conceptos básicos. Seminario web 6: Despliegue de producción

Similar to Kibana+ElasticSearch+LogStash to handle Log messages on Prod servers (20)

PDF
Logs aggregation and analysis
PPTX
Elk ruminating on logs
PDF
Log analysis with the elk stack
PPTX
Elasticsearch features and ecosystem
PPTX
ELK Ruminating on Logs (Zendcon 2016)
PPTX
Log analysis using Logstash,ElasticSearch and Kibana
PPTX
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014
PDF
Technology behind-real-time-log-analytics
DOCX
ESB APPLICTAION IMPROVEMENT -2024 - this
PDF
Setting ELK in 10 minutes on Windows locally
PPTX
Log management with ELK
PPTX
Filebeat Elastic Search Presentation.pptx
PDF
What's new in Elasticsearch v5
PPTX
ELK Solutions Enablement Session - 17th March'2020
PPTX
Elastic stack Presentation
PDF
PPTX
Intro elasticsearch taswarbhatti
PDF
2015 03-16-elk at-bsides
PPTX
ELK Stack
PDF
Introduction to Kibana
Logs aggregation and analysis
Elk ruminating on logs
Log analysis with the elk stack
Elasticsearch features and ecosystem
ELK Ruminating on Logs (Zendcon 2016)
Log analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014
Technology behind-real-time-log-analytics
ESB APPLICTAION IMPROVEMENT -2024 - this
Setting ELK in 10 minutes on Windows locally
Log management with ELK
Filebeat Elastic Search Presentation.pptx
What's new in Elasticsearch v5
ELK Solutions Enablement Session - 17th March'2020
Elastic stack Presentation
Intro elasticsearch taswarbhatti
2015 03-16-elk at-bsides
ELK Stack
Introduction to Kibana
Ad

More from HYS Enterprise (20)

PPTX
Magic of web components
PPTX
“ASP.NET Core. Features and architecture”
PDF
How to create a perfect CV and make a good impression at an interview
PPTX
Top soft skills to get a job
PPTX
Saga pattern
PDF
Wild Async .NET world: AID Kit for boy-scouts
PDF
Contract testing. Getting started with Pact IO.
PDF
Testing strategies in a microservices architecture. Independence vs integration
PPTX
Leonid Sushenko "Pro scrum"
PDF
"Test Design Techniques"
PDF
Essentials soft skills for a developer
PDF
“Tips&Tricks&Antitricks with .Net Core backend in GameDev”
PDF
"Dealing with legacy code"
PDF
“QA job interview: life hacks and scripts for success”
PDF
Evgeniy Burak (HYS Enterprise): “Spring Data REST or intellectual job VS manual”
PDF
Dmitriy Mustafin (HYS Enterprise) "Web UI for Back-end developer."
PPTX
Nikolay Tsyb (HYS Enterprise) "Immortal system as a piece of cake."
PPTX
Я твой Expected Result шатал
PPTX
“Elasticsearch for .NET developers”
PPTX
“Microservices: how to avoid making the same mistake twice.”
Magic of web components
“ASP.NET Core. Features and architecture”
How to create a perfect CV and make a good impression at an interview
Top soft skills to get a job
Saga pattern
Wild Async .NET world: AID Kit for boy-scouts
Contract testing. Getting started with Pact IO.
Testing strategies in a microservices architecture. Independence vs integration
Leonid Sushenko "Pro scrum"
"Test Design Techniques"
Essentials soft skills for a developer
“Tips&Tricks&Antitricks with .Net Core backend in GameDev”
"Dealing with legacy code"
“QA job interview: life hacks and scripts for success”
Evgeniy Burak (HYS Enterprise): “Spring Data REST or intellectual job VS manual”
Dmitriy Mustafin (HYS Enterprise) "Web UI for Back-end developer."
Nikolay Tsyb (HYS Enterprise) "Immortal system as a piece of cake."
Я твой Expected Result шатал
“Elasticsearch for .NET developers”
“Microservices: how to avoid making the same mistake twice.”
Ad

Recently uploaded (20)

PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
PPT on Performance Review to get promotions
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Construction Project Organization Group 2.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
composite construction of structures.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Digital Logic Computer Design lecture notes
PPTX
CH1 Production IntroductoryConcepts.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Operating System & Kernel Study Guide-1 - converted.pdf
PPT on Performance Review to get promotions
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Lecture Notes Electrical Wiring System Components
Construction Project Organization Group 2.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
composite construction of structures.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Digital Logic Computer Design lecture notes
CH1 Production IntroductoryConcepts.pptx
573137875-Attendance-Management-System-original
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Foundation to blockchain - A guide to Blockchain Tech
R24 SURVEYING LAB MANUAL for civil enggi
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Model Code of Practice - Construction Work - 21102022 .pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...

Kibana+ElasticSearch+LogStash to handle Log messages on Prod servers

  • 1. Kibana + ElasticSearch + LogStash By Dmitriy Mustafin JavaMeetup handle Log messages on Prod servers
  • 2. My experience - I started with machine code and punched cards. I used to write on Assembler, then on C and Pascal, С++, Delphi, C#, Javascript, and some other scripting languages. Now I mostly write on Java, and I’m pretty much happy with that. - DOS (it was a wonderful to have 21h interrupt), OS/2, QNX, Windows (my favorite so far), Linux (and Yocto as well), MacOS/iOS. - I studied at university but I still haven't defended my thesis (and I'm not planning on doing this anytime soon). I keep learning new things during my work. - I was writing, designing, engineering, managing and solving problems. - Married, children, cat.
  • 3. HYS Enterprise is a Dutch software development company with more than 200 talented engineers from all over the world hys-enterprise.com
  • 4. Agenda ● What is log and what’s this for? ● How can we do log totally senseless? ● Logging levels or how not to drown in gigs of data ● Most popular logging processors ● Elastic Stack as a result of smoking in the Netherlands ● This beautiful Kibana ● This nimble and gluttonous ElasticSearch ● This terrifying LogStash ● LogStash: real-life example (or even live demo) ● How can we avoid pitfalls of LogStash? ● ElasticBeats or “What else do you want from me?”
  • 5. What is log and what’s this for? In computing, a log file is a file that records either events that occur in an operating system or other software runs, or messages between different users of a communication software. Logging is the act of keeping a log. In the simplest case, messages are written to a single log file. Wikipedia
  • 6. How can we do log totally senseless? Harmful advices: ● Do not use log-files! ● Never put datetime, log level, process id, thread id, specific entity grouping, message itself into log message ● Never make file rolling! ● 15 GB log-file is ok ● 150+ GB log-file is perfect! ● Never zip old files ● Keep log files no more than 1 day (max 2 days) ● Nobody should to know about log-files! ● Never analyze log-files! ● Never put live data on big screen in developers room!
  • 7. Logging levels or how not to drown in gigs of data + custom log levels Standard log levels built-in to Log4J 2 ™ intLevel OFF 0 FATAL 100 ERROR 200 WARN 300 INFO 400 DEBUG 500 TRACE 600 ALL Int max
  • 8. Most popular logging processors Top 10 (?) Log Analysis Tools by KeyCDN: 1. Loggly 2. Logentries 3. GoAccess 4. logz.io 5. Graylog 6. Splunk 7. Logmatic.io 8. Logstash 9. Sumo Logic 10. Papertrail 11. Fluentd
  • 9. Elastic Stack as a result of smoking in the Netherlands ● Original author: Shay Banon ● Stable release: 6.4.2 / October 2, 2018 * ● Repository: github.com/elastic/elasticsearch ● Written in Java ● Operating system: Cross-platform ● Type: Search and index ● License: Apache License 2.0 ● Website: www.elastic.co/products/elasticsearch
  • 10. Elastic Stack as a result of smoking in the Netherlands - cont. ● Shay Banon (Compass) 2004 - Downloads: 0 ● June 2012 - Downloads: <16,000 ● July 2015 - Downloads: 36,431,145 ● October 2015 - Downloads: 44,378,846 ● October 2016 - Downloads: 91,183,928 ● May 2017 - Downloads: 137,715,884 ● October 2017 - Downloads: 192,865,831 ● February 2018 - Downloads: 267,972,265 18 offices in Europe, America, Asia
  • 11. This beautiful Kibana Kibana lets you visualize your Elasticsearch data and navigate the Elastic Stack, so you can do anything from learning why you're getting paged at 2:00 a.m. to understanding the impact rain might have on your quarterly numbers. https://www.elastic.co/products/kibana ● Web UI ● Useful search and filtering ● Visualisations ● Dashboards ● Compute fields
  • 14. This nimble and gluttonous ElasticSearch ElasticSearch is a distributed, RESTful search and analytics engine capable of solving a growing number of use cases. As the heart of the Elastic Stack, it centrally stores your data so you can discover the expected and uncover the unexpected. https://www.elastic.co/products/elasticsearc h ● ElasticSearch Is Fast. Really, Really Fast. ● Run It on Your Laptop or Hundreds of Servers with Petabytes of Data. ● Interact with ElasticSearch in the Programming Language You Choose. ● Extend ElasticSearch.
  • 15. This terrifying LogStash Logstash is an open source, server-side data processing pipeline that ingests data from a multitude of sources simultaneously, transforms it, and then sends it to your favorite “stash”. https://www.elastic.co/products/logstas h ● Takes 1GB or RAM (Java!) ● Parsing and computing @ onboard machine ● Network consumption is tens of MBps ● Looooong start (Java!) ● GrOk and RegExp ● Not easy to debug the script
  • 16. Classic solution: Prod server(s) Kibana server(s) Our Service Log file(s) LogStash ElasticSearch Indexes Kibana How it works
  • 17. LogStash: real-life example (live demo) ● Log file of Spring Boot application ● Log4j2 with MDC for entity grouping ● Sample GrOk config file (input, filter, output) ○ Discussing config file ○ Example of RegExing ○ Example of debugging GrOk matcher ● Start Elastic Stack on Windows machine ● Scan sample log-files ● Magic of Kibana ○ Discovery ○ Visualisation ○ Dashboard
  • 18. How can we avoid pitfalls of LogStash? ● Takes 1GB or RAM (Java!) ⇒ Rewrite it on Go ● Parsing and computing @ onboard machine ⇒ Move to other machine ● Network consumption is tens of MBps ⇒ Zip data (?) ● Looooong start (Java!) ⇒ Rewrite it on Go ● GrOk and RegExp ⇒ Life is pain... ● Not easy to debug the script ⇒ Keep calm and heavy breathing...
  • 19. Prod server(s) Kibana server(s) Our Service Log file(s) LogStash ElasticSearch Indexes Kibana FileBeat Beat solution: How it works now
  • 20. ElasticBeats or “What else do you want from me?” Beats (Lightweight Data Shippers) is the platform for single-purpose data shippers. They install as lightweight agents and send data from hundreds or thousands of machines to Logstash or Elasticsearch. https://www.elastic.co/products/beats ● Filebeat, Metricbeat, Packetbeat, Winlogbeat, Auditbeat, Heartbeat, etc… ● Tens of community beats... ● … and custom Beat constructor
  • 21. Useful links ● About https://en.wikipedia.org/wiki/Kibana ● https://www.elastic.co/products/kibana ● https://www.elastic.co/products/logstash ● https://www.elastic.co/products/elasticsearch ● Easy install-config manual: http://knes1.github.io/blog/2015/2015-08-16-manage-spring-boot-logs-with- elasticsearch-kibana-and-logstash.html ● Default patterns for Grok parser: https://github.com/elastic/logstash/blob/v1.4.2/patterns/grok-patterns ● Web-site to test regular expressions: https://regex101.com/ ● Web-site to test Grok expression: http://grokconstructor.appspot.com ● Search how-to: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/query-dsl-query-string- query.html#query-string-syntax
  • 22. Thank you for your attention! Any Questions?