SlideShare a Scribd company logo
Log Aggregation and Analysis
Using Elastic Stack
Log aggregation and analysis
1
Logging - What ?
●
Human readable and machine parseable format
●
Record now, analyze later
●
Various sources of events
– Webservers
– User activity on a website
– Application logs
– Node metrics
– Other operational data
– Mobile / IoT devices
2
Logging - Why ?
●
Record keeping
●
Operational Insights
– Monitor and optimize resource consumption / utilization
– Early detection – find out before it goes wrong
●
Incident forensics
– Where did it go wrong ?
– Consistency related bugs – Failing system is better than an incosistent system
●
Answer Questions in (near)real-time
– Functional metrics – How many users logged in within last hour?, Which location is most active right now?,
What's the average response time for X page?
3
Available tools
Splunk Graylog Elastic stack
License Paid Free Freemium
Setup
complexity
Easy Medium Medium
Hosting On premise / Hosted On premise / Hosted On-premise / Hosted
Capabilities Ingestion / Storage / Analytics /
Alerts
Ingestion / Storage / Analytics /
Alerts
Ingestion / Storage /
Analytics / Alerts
Scalable ? Yes Yes Yes
Architecture Monolith Monolith Divided into different
components – Each can
be used separately
And many more - Grafana, Logsearch, MS Azure Log Analytics, Loggly
4
Elastic Stack
Explore and visualize your data.
Search, Dashboards and many
more.
Lightweight
data shippers
Parse,
Enrich &
Transport
Data
Store, search, and analyze your
data.
5
Step 1 - Gathering logs
Lightweight Data Shippers
Beats 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.
●
Using log appenders / handlers
●
Beats
6
Beats (by Dre Elastic)
●
Filebeat
– Reads from file
– Non-intrusive
●
Metricbeat
– Collects metrics from systems and services
– Modules available for Apache, nginx, Docker, Kafka, PostgreSQL and more
●
Packetbeat
– Lightweight network packet analyzer
– Modules available for HTTP, DNS, AMQP and more
●
Winlogbeat
– Collects windows event logs
●
Add your own
– Dozens of community developed beats available
– Extensible architecture – Easy to create on our own
– Written in Go
7
Filebeat
filebeat:
  prospectors:
   ­
     paths:
       ­ /var/log/*.log
     input_type: log
   ­
     paths:
       ­ /var/log/apache2/*
     input_type: log
output:
  elasticsearch:
    hosts: ["localhost:9200"]
Sample confiuration :
{
  "@timestamp": "2016­01­06T00:00:00Z",
  "type": "log",
  "message": "<line from file>"
}
Sample published event:
8
Metricbeat
metricbeat.modules:
­ module: redis
  metricsets:
    ­ info
  hosts: ["127.0.0.1:6379"]
output.elasticsearch:
  hosts: ["localhost:9200"]
Sample configuration:
{
  "@timestamp": "2016­01­06T00:00:00Z",
  "type": "metricsets",
  "redis": {
    ...
  }
}
Sample published event:
9
Step 2 - Processing logs using Logstash
●
Ingest-process-output pipeline
●
Ingest Data of All Shapes, Sizes, and Sources
– Beats, log4j, redis, tcp/udp, HTTP
●
Process
– Transform unstructured data to structured data using grok filter
– Filter out unnecessary data
– Mutate data (calculate fields, add extra context, get geo co-ordinates from IP address, etc)
●
Stash it away
– Data stores (elasticsearch, files, mongoDB, redis), other services (email, pagerduty, redmine,
irc, jira), brokers (kafka, rabbitMQ) and many more
●
Scalable, Durable
10
Logstash – contd.
GeoIP Lookup /
Data Mutation /
Structuring data
input {
  beats {
port => 5044
}
}
filter{
    if[type] == "nginx­logs" {
        grok {
            match => {"message" => "%{PATTERN}"}
        }
        geoip {
            source => "remote_addr"
        }
    }
}
output {
    elasticsearch {
     hosts => ["localhost:9200"]
       index => "logstash­%{+YYYY.MM.dd}"
}
}
Sample confiuration :
11
Step 3 - Storing logs in Elasticsearch
●
Distributed RESTful search and analytics engine (JSON/HTTP)
●
Fast – get your answers instantly
●
Scalable – Run on your laptop or hundreds of servers
●
Resilient and Highly Available – Clustering, Failure detection
●
Full text search, Aggregation, Geo filtering (within x mile radius),
Suggestions (show more like this), Fuzzy search, Scripting
12
Step 4 - Explore and Visualize using Kibana
●
Works seamlessly with Elasticsearch
●
Easy yet powerful search interface
●
Supports histograms, line graphs, pie charts and many more
●
Visualize geospatial data
●
Extensible – Create your own visualization
●
Create and share dashboards
13
Elastic Stack in Action
14
Demo 1 – Parsing nginx logs
Nginx
Access
Logs
Filebeat
conf
Filebeat
Read file(s)
push to Logstash
Logstash
Parse logs
GeoIP lookup
User agent parsing
Push to Elasticsearch
Elasticsearch
Index and store
Kibana
Search and Analyze
15
Demo 2 – Logs from a Django application
Elasticsearch
Index and store
Kibana
Search and Analyze
Logstash
Collect logs
Push to Elasticsearch
Django App
Logstash handler
16
Demo 3 – Capture and monitor node metrics
Metricbeat
conf
Metricbeat
Read metrics
from nodes
Elasticsearch
Index and store
Kibana
Search and Analyze
17
Q & A
18
Thank You
Ahmedabad Java Meetup Group
https://www.meetup.com/Ahmedabad-Java-Meetup-Group/
@JavaMeetup AhmedabadJavaMeetup
Dhaval Mehta
dmehta17@gmail.com
@mehtadhaval07

More Related Content

What's hot (20)

PDF
Elk devops
Ideato
 
PDF
ELK, a real case study
Paolo Tonin
 
PPTX
Toronto High Scalability meetup - Scaling ELK
Andrew Trossman
 
PPTX
Log management with ELK
Geert Pante
 
PPTX
Elastic - ELK, Logstash & Kibana
SpringPeople
 
PDF
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Andrii Vozniuk
 
PPTX
Elk
Caleb Wang
 
PDF
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Surasak Sanguanpong
 
PPTX
ELK Elasticsearch Logstash and Kibana Stack for Log Management
El Mahdi Benzekri
 
PDF
Monitoramento com ELK - Elasticsearch - Logstash - Kibana
Waldemar Neto
 
PDF
Presto Strata Hadoop SJ 2016 short talk
kbajda
 
PDF
Centralized logging system using mongoDB
Vivek Parihar
 
PDF
Norikra Recent Updates
SATOSHI TAGOMORI
 
PDF
Fluentd and Docker - running fluentd within a docker container
Treasure Data, Inc.
 
PPTX
Elk meetup boston - logz.io
tomerlevy9
 
PDF
Logstash family introduction
Owen Wu
 
PDF
Presto @ Treasure Data - Presto Meetup Boston 2015
Taro L. Saito
 
PPTX
Hello, Enterprise! Meet Presto. (Presto Boston Meetup 10062015)
Matt Fuller
 
PDF
Presto meetup 2015-03-19 @Facebook
Treasure Data, Inc.
 
Elk devops
Ideato
 
ELK, a real case study
Paolo Tonin
 
Toronto High Scalability meetup - Scaling ELK
Andrew Trossman
 
Log management with ELK
Geert Pante
 
Elastic - ELK, Logstash & Kibana
SpringPeople
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Andrii Vozniuk
 
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Surasak Sanguanpong
 
ELK Elasticsearch Logstash and Kibana Stack for Log Management
El Mahdi Benzekri
 
Monitoramento com ELK - Elasticsearch - Logstash - Kibana
Waldemar Neto
 
Presto Strata Hadoop SJ 2016 short talk
kbajda
 
Centralized logging system using mongoDB
Vivek Parihar
 
Norikra Recent Updates
SATOSHI TAGOMORI
 
Fluentd and Docker - running fluentd within a docker container
Treasure Data, Inc.
 
Elk meetup boston - logz.io
tomerlevy9
 
Logstash family introduction
Owen Wu
 
Presto @ Treasure Data - Presto Meetup Boston 2015
Taro L. Saito
 
Hello, Enterprise! Meet Presto. (Presto Boston Meetup 10062015)
Matt Fuller
 
Presto meetup 2015-03-19 @Facebook
Treasure Data, Inc.
 

Similar to Log aggregation and analysis (20)

PDF
OSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica Sarbu
NETWAYS
 
PPT
Elk presentation 2#3
uzzal basak
 
PDF
Playground 11022017 user_monitoring
Matthijs Mali
 
PDF
Combining logs, metrics, and traces for unified observability
Elasticsearch
 
PDF
Combinación de logs, métricas y seguimiento para una visibilidad centralizada
Elasticsearch
 
PDF
Combinación de logs, métricas y seguimiento para una visibilidad centralizada
Elasticsearch
 
PDF
Technology behind-real-time-log-analytics
Data Science Thailand
 
PDF
Combining Logs, Metrics, and Traces for Unified Observability
Elasticsearch
 
PPTX
Kibana+ElasticSearch+LogStash to handle Log messages on Prod servers
HYS Enterprise
 
PDF
Combinação de logs, métricas e rastreamentos para observabilidade unificada
Elasticsearch
 
PPTX
centralization of log systems pour suivis
Thierry Gayet
 
ODP
Elastic Stack ELK, Beats, and Cloud
Joe Ryan
 
PDF
Full stack visibility with elastic, KubeCon 2017
Carlos Pérez-Aradros
 
PDF
Log Management: AtlSecCon2015
cameronevans
 
PPTX
Rootconf 2017 - State of the Open Source monitoring landscape
NETWAYS
 
DOCX
Log management with_logstash_and_elastic_search
Rishav Rohit
 
PDF
[131] packetbeat과 elasticsearch
NAVER D2
 
PPTX
Elastic Stack Introduction
Vikram Shinde
 
PDF
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue
 
PPTX
The Elastic Stack as a SIEM
John Hubbard
 
OSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica Sarbu
NETWAYS
 
Elk presentation 2#3
uzzal basak
 
Playground 11022017 user_monitoring
Matthijs Mali
 
Combining logs, metrics, and traces for unified observability
Elasticsearch
 
Combinación de logs, métricas y seguimiento para una visibilidad centralizada
Elasticsearch
 
Combinación de logs, métricas y seguimiento para una visibilidad centralizada
Elasticsearch
 
Technology behind-real-time-log-analytics
Data Science Thailand
 
Combining Logs, Metrics, and Traces for Unified Observability
Elasticsearch
 
Kibana+ElasticSearch+LogStash to handle Log messages on Prod servers
HYS Enterprise
 
Combinação de logs, métricas e rastreamentos para observabilidade unificada
Elasticsearch
 
centralization of log systems pour suivis
Thierry Gayet
 
Elastic Stack ELK, Beats, and Cloud
Joe Ryan
 
Full stack visibility with elastic, KubeCon 2017
Carlos Pérez-Aradros
 
Log Management: AtlSecCon2015
cameronevans
 
Rootconf 2017 - State of the Open Source monitoring landscape
NETWAYS
 
Log management with_logstash_and_elastic_search
Rishav Rohit
 
[131] packetbeat과 elasticsearch
NAVER D2
 
Elastic Stack Introduction
Vikram Shinde
 
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue
 
The Elastic Stack as a SIEM
John Hubbard
 
Ad

Recently uploaded (20)

PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Digital Circuits, important subject in CS
contactparinay1
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Ad

Log aggregation and analysis

  • 1. Log Aggregation and Analysis Using Elastic Stack
  • 3. 1 Logging - What ? ● Human readable and machine parseable format ● Record now, analyze later ● Various sources of events – Webservers – User activity on a website – Application logs – Node metrics – Other operational data – Mobile / IoT devices
  • 4. 2 Logging - Why ? ● Record keeping ● Operational Insights – Monitor and optimize resource consumption / utilization – Early detection – find out before it goes wrong ● Incident forensics – Where did it go wrong ? – Consistency related bugs – Failing system is better than an incosistent system ● Answer Questions in (near)real-time – Functional metrics – How many users logged in within last hour?, Which location is most active right now?, What's the average response time for X page?
  • 5. 3 Available tools Splunk Graylog Elastic stack License Paid Free Freemium Setup complexity Easy Medium Medium Hosting On premise / Hosted On premise / Hosted On-premise / Hosted Capabilities Ingestion / Storage / Analytics / Alerts Ingestion / Storage / Analytics / Alerts Ingestion / Storage / Analytics / Alerts Scalable ? Yes Yes Yes Architecture Monolith Monolith Divided into different components – Each can be used separately And many more - Grafana, Logsearch, MS Azure Log Analytics, Loggly
  • 6. 4 Elastic Stack Explore and visualize your data. Search, Dashboards and many more. Lightweight data shippers Parse, Enrich & Transport Data Store, search, and analyze your data.
  • 7. 5 Step 1 - Gathering logs Lightweight Data Shippers Beats 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. ● Using log appenders / handlers ● Beats
  • 8. 6 Beats (by Dre Elastic) ● Filebeat – Reads from file – Non-intrusive ● Metricbeat – Collects metrics from systems and services – Modules available for Apache, nginx, Docker, Kafka, PostgreSQL and more ● Packetbeat – Lightweight network packet analyzer – Modules available for HTTP, DNS, AMQP and more ● Winlogbeat – Collects windows event logs ● Add your own – Dozens of community developed beats available – Extensible architecture – Easy to create on our own – Written in Go
  • 11. 9 Step 2 - Processing logs using Logstash ● Ingest-process-output pipeline ● Ingest Data of All Shapes, Sizes, and Sources – Beats, log4j, redis, tcp/udp, HTTP ● Process – Transform unstructured data to structured data using grok filter – Filter out unnecessary data – Mutate data (calculate fields, add extra context, get geo co-ordinates from IP address, etc) ● Stash it away – Data stores (elasticsearch, files, mongoDB, redis), other services (email, pagerduty, redmine, irc, jira), brokers (kafka, rabbitMQ) and many more ● Scalable, Durable
  • 12. 10 Logstash – contd. GeoIP Lookup / Data Mutation / Structuring data input {   beats { port => 5044 } } filter{     if[type] == "nginx­logs" {         grok {             match => {"message" => "%{PATTERN}"}         }         geoip {             source => "remote_addr"         }     } } output {     elasticsearch {      hosts => ["localhost:9200"]        index => "logstash­%{+YYYY.MM.dd}" } } Sample confiuration :
  • 13. 11 Step 3 - Storing logs in Elasticsearch ● Distributed RESTful search and analytics engine (JSON/HTTP) ● Fast – get your answers instantly ● Scalable – Run on your laptop or hundreds of servers ● Resilient and Highly Available – Clustering, Failure detection ● Full text search, Aggregation, Geo filtering (within x mile radius), Suggestions (show more like this), Fuzzy search, Scripting
  • 14. 12 Step 4 - Explore and Visualize using Kibana ● Works seamlessly with Elasticsearch ● Easy yet powerful search interface ● Supports histograms, line graphs, pie charts and many more ● Visualize geospatial data ● Extensible – Create your own visualization ● Create and share dashboards
  • 16. 14 Demo 1 – Parsing nginx logs Nginx Access Logs Filebeat conf Filebeat Read file(s) push to Logstash Logstash Parse logs GeoIP lookup User agent parsing Push to Elasticsearch Elasticsearch Index and store Kibana Search and Analyze
  • 17. 15 Demo 2 – Logs from a Django application Elasticsearch Index and store Kibana Search and Analyze Logstash Collect logs Push to Elasticsearch Django App Logstash handler
  • 18. 16 Demo 3 – Capture and monitor node metrics Metricbeat conf Metricbeat Read metrics from nodes Elasticsearch Index and store Kibana Search and Analyze
  • 20. 18 Thank You Ahmedabad Java Meetup Group https://www.meetup.com/Ahmedabad-Java-Meetup-Group/ @JavaMeetup AhmedabadJavaMeetup Dhaval Mehta [email protected] @mehtadhaval07