SlideShare a Scribd company logo
From Zero to Hero 
Rafał Kuć – Sematext Group, Inc. 
@kucrafal @sematext sematext.com 
Easy log centralization 
with Logstash & Elasticsearch
About me… 
Sematext consultant & engineer 
Solr.pl co-founder 
Father and husband 
The problem
The problem 
Log 
Log 
Log 
Log 
Log 
Log 
Log 
Log 
Log
Let’s find something 
http://www.likesbooks.com/aarafterhours/?p=750
The solution 
Log 
Log 
Log 
Log 
Log 
Log 
Log 
Log
Available tools
Available tools 
…
But why search? 
Easy to find related data
But why search? 
Easy to find related data 
Fast and accurate
But why search? 
Easy to find related data 
Fast and accurate 
Real time data insight and analysis
Why Elasticsearch? 
Reasonable 
defaults 
Distributed 
by design 
http://www.dailypets.co.uk/2007/06/17/kittens-rest-at-half-time/
Installation 
$ wget --no-check-certificate 
https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz
Installation 
$ wget --no-check-certificate 
https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz 
$ tar –xvf elasticsearch-1.3.2.tar.gz 
$ elasticsearch-1.3.2/bin/elasticsearch
Installation 
$ wget --no-check-certificate 
https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz 
$ tar –xvf elasticsearch-1.3.2.tar.gz 
$ elasticsearch-1.3.2/bin/elasticsearch
Scalable
Scalable
Scalable
Configuration - stability
Configuration - stability
Configuration - stability
Configuration - stability 
minimum_master_nodes 
= 
N/2 + 1
Configuration - stability 
Master only 
Master only 
Master only 
Data only 
Data only 
Data only 
Data only 
Data only 
Data only 
Client only 
Client only 
minimum_master_nodes 
= 
N/2 + 1
Thread pools
Thread pools 
Use 
fixed 
Set 
size 
Set 
queue
Thread pools 
threadpool.search.type 
threadpool.search.size 
threadpool.search.queue_size 
threadpool.index.type 
threadpool.index.size 
threadpool.index.queue_size 
threadpool.bulk.type 
threadpool.bulk.size 
threadpool.bulk.queue_size 
Use 
fixed 
Set 
size 
Set 
queue
Circuit breakers, caches == no OOM 
indices.breaker.fielddata.limit 
indices.breaker.fielddata.overhead 
40% Xmx 
1
Circuit breakers, caches == no OOM 
indices.breaker.fielddata.limit 
indices.breaker.fielddata.overhead 
indices.breaker.request.limit 
indices.breaker.request.overhead 
60% Xmx 
1.03 
40% Xmx 
1
Circuit breakers, caches == no OOM 
indices.breaker.fielddata.limit 
indices.breaker.fielddata.overhead 
indices.breaker.request.limit 
indices.breaker.request.overhead 
indices.breaker.total.limit 
70% Xmx 
60% Xmx 
1.03 
40% Xmx 
1
Circuit breakers, caches == no OOM 
indices.breaker.fielddata.limit 
indices.breaker.fielddata.overhead 
indices.breaker.request.limit 
indices.breaker.request.overhead 
indices.breaker.total.limit 
indices.fielddata.cache.size 
unbounded 
70% Xmx 
60% Xmx 
1.03 
40% Xmx 
1
Circuit breakers, caches == no OOM 
indices.breaker.fielddata.limit 
indices.breaker.fielddata.overhead 
indices.breaker.request.limit 
indices.breaker.request.overhead 
indices.breaker.total.limit 
indices.fielddata.cache.size 
indices.cache.filter.size 
unbounded 
10% 
70% Xmx 
60% Xmx 
1.03 
40% Xmx 
1
Configuration - indexing 
Log
Configuration - indexing 
Log
Configuration - indexing 
Log 
Log 
Log 
Log 
Log 
Log 
Log 
Log 
Log 
Use 
Bulk! 
Or UDP 
Bulk!
Configuration - indexing 
Log 
Log 
Log 
Log 
Log 
Log 
Log 
Log 
Log 
index.translog.flush_threshold_ops 
index.translog.flush_threshold_size 
unlimited 
200mb 
Use 
Bulk! 
Or UDP 
Bulk!
Refresh when needed 
1s refresh -> 2K logs/sec 
http://blog.sematext.com/2013/07/08/elasticsearch-refresh-interval-vs-indexing-performance/
Refresh when needed 
1s refresh -> 2K logs/sec 
http://blog.sematext.com/2013/07/08/elasticsearch-refresh-interval-vs-indexing-performance/ 
5s refresh -> 2.5K logs/sec
Refresh when needed 
1s refresh -> 2K logs/sec 
http://blog.sematext.com/2013/07/08/elasticsearch-refresh-interval-vs-indexing-performance/ 
5s refresh -> 2.5K logs/sec 
30s refresh -> 3.4K logs/sec
Data volume under control 
2014-09-24
Data volume under control 
2014-09-24 
TODAY
Data volume under control 
2014-09-24 
TODAY 
WEEK
Data volume under control 
2014-09-24 
2014-09-25 
TODAY 
WEEK
Data volume under control 
2014-09-24 
2014-09-25 
2014-09-26 
TODAY 
WEEK
Monitoring
Monitoring
Monitoring
SPM 
http://sematext.com/spm/
SPM 
http://sematext.com/spm/
SPM 
http://sematext.com/spm/
SPM 
http://sematext.com/spm/
Here comes Logstash 
Unstructured
Here comes Logstash 
Unstructured
Here comes Logstash 
Unstructured 
Documents
Processing example 
127.0.0.1 - - [05/Feb/2014:17:11:55 +0000] "GET /css/main.css HTTP/1.1" 200 140 "http://www.onet.pl" 
"Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
Processing example 
127.0.0.1 - - [05/Feb/2014:17:11:55 +0000] "GET /css/main.css HTTP/1.1" 200 140 "http://www.onet.pl" 
"Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
Processing example 
127.0.0.1 - - [05/Feb/2014:17:11:55 +0000] "GET /css/main.css HTTP/1.1" 200 140 "http://www.onet.pl" 
"Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" 
{ 
"host" : "127.0.0.1", 
"@timestamp" : "2014-02-05T17:11:55+0000", 
... 
"verb" : "GET" 
}
How does it look?
Of course you can scale
Logstash input 
input { 
file { 
path => "/var/log/apache/apache.log" 
type => "access_apache_log" 
start_position => "beginning" 
} 
}
Grok 
filter { 
if [type] == "access_apache_log" { 
grok { 
match => { 
"message" => "%{COMBINEDAPACHELOG}" 
} 
} 
} 
}
Logstash output 
output { 
elasticsearch { 
host => "localhost" 
port => 9200 
index => "logs_%{+YYYY.MM.dd}" 
protocol => "http" 
manage_template => true 
} 
}
Sample Logstash-forwarder config 
{ 
"network": { 
"servers": [ "localhost:5043" ], 
"timeout": 15 
}, 
"files": [ 
{ 
"paths": [ 
"/var/log/apache/apache*.log" 
], 
"fields": { "type": "access_apache_log" } 
} 
] 
}
Sample Logstash-forwarder config 
{ 
"network": { 
"servers": [ "localhost:5043" ], 
"timeout": 15 
}, 
"files": [ 
{ 
"paths": [ 
"/var/log/apache/apache*.log" 
], 
"fields": { "type": "access_apache_log" } 
} 
] 
} 
Logstash side: 
input { 
lumberjack { 
port => 5043 
type => "access_apache_log" 
} 
}
Let’s try it 
$ bin/logstash –f logstash-filter.conf
Let’s try it 
$ bin/logstash –f logstash-filter.conf 
$ curl 'localhost:9200/logs_2014-09-26/_search?pretty'
Let’s try it 
$ bin/logstash –f logstash-filter.conf 
$ curl 'localhost:9200/logs_2014-09-26/_search?pretty' 
{ 
"took" : 3, 
"timed_out" : false, 
"_shards" : { 
"total" : 5, 
"successful" : 5, 
"failed" : 0 
}, 
"hits" : { 
"total" : 3, 
"max_score" : 1.0, 
"hits" : [ { 
"_index" : "logs", 
"_type" : "access_apache_log", 
"_id" : "SI0BZw8BQ0uQNPtk9zfoOQ", 
"_score" : 1.0, 
"_source":{"message":"71.141.244.242 - kurt [18/May/2011:01:48:10 -0700] "GET /admin HTTP/1.1" 301 566 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"","@version":"1","@timestamp":"2014-09-11T10:21:04.403Z","type":"access_apache_log","host":"developer-vb","path":"/home/gro/devops/apache3.log","clientip":"71.141.244.242","ident":"- ","auth":"kurt","timestamp":"18/May/2011:01:48:10 -0700","verb":"GET","request":"/admin","httpversion":"1.1","response":"301","bytes":"566","referrer":""-"","agent":""Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3""} 
}, { 
"_index" : "logs", 
"_type" : "access_apache_log", 
"_id" : "zyOc53uwQkegOQr-a3hwIQ", 
"_score" : 1.0, 
"_source":{"message":"98.83.179.51 - - [18/May/2011:19:35:08 -0700] "GET /css/main.css HTTP/1.1" 200 1837 "http://www.safesand.com/information.htm" "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"","@version":"1","@timestamp":"2014-09-11T10:21:04.405Z","type":"access_apache_log","host":"developer- vb","path":"/home/gro/devops/apache3.log","clientip":"98.83.179.51","ident":"-","auth":"-","timestamp":"18/May/2011:19:35:08 - 0700","verb":"GET","request":"/css/main.css","httpversion":"1.1","response":"200","bytes":"1837","referrer":""http://www.safesand.com/information.htm"","agent":""Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1""} 
}, { 
"_index" : "logs", 
"_type" : "access_apache_log", 
"_id" : "evP0I--3TWOlDsQzalQtAw", 
"_score" : 1.0, 
"_source":{"message":"134.39.72.245 - - [18/May/2011:12:40:18 -0700] "GET /favicon.ico HTTP/1.1" 200 1189 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E)"","@version":"1","@timestamp":"2014-09-11T10:21:04.404Z","type":"access_apache_log","host":"developer- vb","path":"/home/gro/devops/apache3.log","clientip":"134.39.72.245","ident":"-","auth":"-","timestamp":"18/May/2011:12:40:18 - 0700","verb":"GET","request":"/favicon.ico","httpversion":"1.1","response":"200","bytes":"1189","referrer":""-"","agent":""Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E)""} 
} ] 
} 
}
Here comes Kibana
Looking for SaaS – Go Logsene 
http://sematext.com/logsene
Looking for SaaS – Go Logsene 
http://sematext.com/logsene
Logstash + Logsene in action 
output { 
elasticsearch { 
host => "logsene-receiver.sematext.com" 
port => 80 
index => "YOUR_TOKEN" 
protocol => "http" 
manage_template => false 
} 
} 
http://sematext.com/logsene
Short summary 
http://www.soothetube.com/2013/12/29/thats-all-folks/
We Are Hiring ! 
Dig Search ? 
Dig Analytics ? 
Dig Big Data ? 
Dig Performance ? 
Dig Logging ? 
Dig working with and in open – source ? 
We’re hiring world – wide ! 
http://sematext.com/about/jobs.html
Rafał Kuć 
@kucrafal 
rafal.kuc@sematext.com 
Sematext 
@sematext 
http://sematext.com 
http://blog.sematext.com 
Thank You !

More Related Content

PDF
On Centralizing Logs
PPTX
Big Data Day LA 2016/ Big Data Track - Fluentd and Embulk: Collect More Data,...
PDF
Application Logging With Logstash
PPTX
MySQL Slow Query log Monitoring using Beats & ELK
PDF
Tuning Solr for Logs
PDF
Solr for Indexing and Searching Logs
PPT
ELK stack at weibo.com
PPT
Logstash
On Centralizing Logs
Big Data Day LA 2016/ Big Data Track - Fluentd and Embulk: Collect More Data,...
Application Logging With Logstash
MySQL Slow Query log Monitoring using Beats & ELK
Tuning Solr for Logs
Solr for Indexing and Searching Logs
ELK stack at weibo.com
Logstash

What's hot (20)

PDF
Logstash family introduction
PPTX
Managing Your Security Logs with Elasticsearch
PDF
Tuning Solr & Pipeline for Logs
PDF
Elasticsearch for Logs & Metrics - a deep dive
PDF
Dive into Fluentd plugin v0.12
PPT
{{more}} Kibana4
PDF
Fluentd v1.0 in a nutshell
PDF
Fluentd v0.12 master guide
PPTX
Monitoring Docker with ELK
PPT
Large Scale Log collection using LogStash & mongoDB
PDF
Rihards Olups - Encrypting Daemon Traffic With Zabbix 3.0
PDF
elk_stack_alexander_szalonnas
PPTX
The tale of 100 cve's
PDF
NginX - good practices, tips and advanced techniques
PPT
Learn ELK in docker
PDF
Securing Prometheus exporters using HashiCorp Vault
PPT
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
PDF
Logging logs with Logstash - Devops MK 10-02-2016
PDF
Aaron Mildenstein - Using Logstash with Zabbix
PDF
Fluentd v1 and Roadmap
Logstash family introduction
Managing Your Security Logs with Elasticsearch
Tuning Solr & Pipeline for Logs
Elasticsearch for Logs & Metrics - a deep dive
Dive into Fluentd plugin v0.12
{{more}} Kibana4
Fluentd v1.0 in a nutshell
Fluentd v0.12 master guide
Monitoring Docker with ELK
Large Scale Log collection using LogStash & mongoDB
Rihards Olups - Encrypting Daemon Traffic With Zabbix 3.0
elk_stack_alexander_szalonnas
The tale of 100 cve's
NginX - good practices, tips and advanced techniques
Learn ELK in docker
Securing Prometheus exporters using HashiCorp Vault
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Logging logs with Logstash - Devops MK 10-02-2016
Aaron Mildenstein - Using Logstash with Zabbix
Fluentd v1 and Roadmap
Ad

Viewers also liked (6)

PDF
Application Logging With The ELK Stack
PDF
Fluentd and docker monitoring
PDF
Fluentd and PHP
PDF
Integrando Redis en aplicaciones Symfony2
PDF
Fluentd vs. Logstash for OpenStack Log Management
PDF
Logging with Elasticsearch, Logstash & Kibana
Application Logging With The ELK Stack
Fluentd and docker monitoring
Fluentd and PHP
Integrando Redis en aplicaciones Symfony2
Fluentd vs. Logstash for OpenStack Log Management
Logging with Elasticsearch, Logstash & Kibana
Ad

Similar to From Zero to Hero - Centralized Logging with Logstash & Elasticsearch (20)

KEY
London devops logging
PPTX
Tuning Elasticsearch Indexing Pipeline for Logs
PDF
ELK stack introduction
PPTX
Centralized log-management-with-elastic-stack
PPTX
Scaling an ELK stack at bol.com
PDF
Null Bachaav - May 07 Attack Monitoring workshop.
PPT
How ElasticSearch lives in my DevOps life
PDF
Tuning Solr for Logs: Presented by Radu Gheorghe, Sematext
PDF
Managing Your Content with Elasticsearch
KEY
Zero mq logs
PPTX
Attack monitoring using ElasticSearch Logstash and Kibana
PPTX
Search and analyze data in real time
PDF
VictoriaLogs: Open Source Log Management System - Preview
PDF
Brisbane DevOps Meetup - Logstash
PDF
Es part 2 pdf no build
PPT
'Scalable Logging and Analytics with LogStash'
PDF
ELK: Moose-ively scaling your log system
KEY
Message:Passing - lpw 2012
PDF
Log analysis with the elk stack
PPTX
Toronto High Scalability meetup - Scaling ELK
London devops logging
Tuning Elasticsearch Indexing Pipeline for Logs
ELK stack introduction
Centralized log-management-with-elastic-stack
Scaling an ELK stack at bol.com
Null Bachaav - May 07 Attack Monitoring workshop.
How ElasticSearch lives in my DevOps life
Tuning Solr for Logs: Presented by Radu Gheorghe, Sematext
Managing Your Content with Elasticsearch
Zero mq logs
Attack monitoring using ElasticSearch Logstash and Kibana
Search and analyze data in real time
VictoriaLogs: Open Source Log Management System - Preview
Brisbane DevOps Meetup - Logstash
Es part 2 pdf no build
'Scalable Logging and Analytics with LogStash'
ELK: Moose-ively scaling your log system
Message:Passing - lpw 2012
Log analysis with the elk stack
Toronto High Scalability meetup - Scaling ELK

More from Sematext Group, Inc. (20)

PDF
Tweaking the Base Score: Lucene/Solr Similarities Explained
PDF
OOPs, OOMs, oh my! Containerizing JVM apps
PPTX
Is observability good for your brain?
PDF
Introducing log analysis to your organization
PPTX
Solr Search Engine: Optimize Is (Not) Bad for You
PDF
Solr on Docker - the Good, the Bad and the Ugly
PDF
Monitoring and Log Management for
PDF
Introduction to solr
PDF
Building Resilient Log Aggregation Pipeline with Elasticsearch & Kafka
PDF
How to Run Solr on Docker and Why
PPTX
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
PDF
Top Node.js Metrics to Watch
PDF
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)
PDF
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
PDF
Docker Logging Webinar
PDF
Docker Monitoring Webinar
PDF
Metrics, Logs, Transaction Traces, Anomaly Detection at Scale
PDF
Side by Side with Elasticsearch & Solr, Part 2
PDF
Solr Anti Patterns
PDF
(Elastic)search in big data
Tweaking the Base Score: Lucene/Solr Similarities Explained
OOPs, OOMs, oh my! Containerizing JVM apps
Is observability good for your brain?
Introducing log analysis to your organization
Solr Search Engine: Optimize Is (Not) Bad for You
Solr on Docker - the Good, the Bad and the Ugly
Monitoring and Log Management for
Introduction to solr
Building Resilient Log Aggregation Pipeline with Elasticsearch & Kafka
How to Run Solr on Docker and Why
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Top Node.js Metrics to Watch
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
Docker Logging Webinar
Docker Monitoring Webinar
Metrics, Logs, Transaction Traces, Anomaly Detection at Scale
Side by Side with Elasticsearch & Solr, Part 2
Solr Anti Patterns
(Elastic)search in big data

Recently uploaded (20)

PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Cloud computing and distributed systems.
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Advanced IT Governance
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
GamePlan Trading System Review: Professional Trader's Honest Take
Diabetes mellitus diagnosis method based random forest with bat algorithm
Cloud computing and distributed systems.
Unlocking AI with Model Context Protocol (MCP)
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
NewMind AI Weekly Chronicles - August'25 Week I
The Rise and Fall of 3GPP – Time for a Sabbatical?
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Advanced Soft Computing BINUS July 2025.pdf
Big Data Technologies - Introduction.pptx
Spectral efficient network and resource selection model in 5G networks
20250228 LYD VKU AI Blended-Learning.pptx
Advanced IT Governance
Review of recent advances in non-invasive hemoglobin estimation
Network Security Unit 5.pdf for BCA BBA.
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....

From Zero to Hero - Centralized Logging with Logstash & Elasticsearch

  • 1. From Zero to Hero Rafał Kuć – Sematext Group, Inc. @kucrafal @sematext sematext.com Easy log centralization with Logstash & Elasticsearch
  • 2. About me… Sematext consultant & engineer Solr.pl co-founder Father and husband 
  • 4. The problem Log Log Log Log Log Log Log Log Log
  • 5. Let’s find something http://www.likesbooks.com/aarafterhours/?p=750
  • 6. The solution Log Log Log Log Log Log Log Log
  • 9. But why search? Easy to find related data
  • 10. But why search? Easy to find related data Fast and accurate
  • 11. But why search? Easy to find related data Fast and accurate Real time data insight and analysis
  • 12. Why Elasticsearch? Reasonable defaults Distributed by design http://www.dailypets.co.uk/2007/06/17/kittens-rest-at-half-time/
  • 13. Installation $ wget --no-check-certificate https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz
  • 14. Installation $ wget --no-check-certificate https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz $ tar –xvf elasticsearch-1.3.2.tar.gz $ elasticsearch-1.3.2/bin/elasticsearch
  • 15. Installation $ wget --no-check-certificate https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz $ tar –xvf elasticsearch-1.3.2.tar.gz $ elasticsearch-1.3.2/bin/elasticsearch
  • 22. Configuration - stability minimum_master_nodes = N/2 + 1
  • 23. Configuration - stability Master only Master only Master only Data only Data only Data only Data only Data only Data only Client only Client only minimum_master_nodes = N/2 + 1
  • 25. Thread pools Use fixed Set size Set queue
  • 26. Thread pools threadpool.search.type threadpool.search.size threadpool.search.queue_size threadpool.index.type threadpool.index.size threadpool.index.queue_size threadpool.bulk.type threadpool.bulk.size threadpool.bulk.queue_size Use fixed Set size Set queue
  • 27. Circuit breakers, caches == no OOM indices.breaker.fielddata.limit indices.breaker.fielddata.overhead 40% Xmx 1
  • 28. Circuit breakers, caches == no OOM indices.breaker.fielddata.limit indices.breaker.fielddata.overhead indices.breaker.request.limit indices.breaker.request.overhead 60% Xmx 1.03 40% Xmx 1
  • 29. Circuit breakers, caches == no OOM indices.breaker.fielddata.limit indices.breaker.fielddata.overhead indices.breaker.request.limit indices.breaker.request.overhead indices.breaker.total.limit 70% Xmx 60% Xmx 1.03 40% Xmx 1
  • 30. Circuit breakers, caches == no OOM indices.breaker.fielddata.limit indices.breaker.fielddata.overhead indices.breaker.request.limit indices.breaker.request.overhead indices.breaker.total.limit indices.fielddata.cache.size unbounded 70% Xmx 60% Xmx 1.03 40% Xmx 1
  • 31. Circuit breakers, caches == no OOM indices.breaker.fielddata.limit indices.breaker.fielddata.overhead indices.breaker.request.limit indices.breaker.request.overhead indices.breaker.total.limit indices.fielddata.cache.size indices.cache.filter.size unbounded 10% 70% Xmx 60% Xmx 1.03 40% Xmx 1
  • 34. Configuration - indexing Log Log Log Log Log Log Log Log Log Use Bulk! Or UDP Bulk!
  • 35. Configuration - indexing Log Log Log Log Log Log Log Log Log index.translog.flush_threshold_ops index.translog.flush_threshold_size unlimited 200mb Use Bulk! Or UDP Bulk!
  • 36. Refresh when needed 1s refresh -> 2K logs/sec http://blog.sematext.com/2013/07/08/elasticsearch-refresh-interval-vs-indexing-performance/
  • 37. Refresh when needed 1s refresh -> 2K logs/sec http://blog.sematext.com/2013/07/08/elasticsearch-refresh-interval-vs-indexing-performance/ 5s refresh -> 2.5K logs/sec
  • 38. Refresh when needed 1s refresh -> 2K logs/sec http://blog.sematext.com/2013/07/08/elasticsearch-refresh-interval-vs-indexing-performance/ 5s refresh -> 2.5K logs/sec 30s refresh -> 3.4K logs/sec
  • 39. Data volume under control 2014-09-24
  • 40. Data volume under control 2014-09-24 TODAY
  • 41. Data volume under control 2014-09-24 TODAY WEEK
  • 42. Data volume under control 2014-09-24 2014-09-25 TODAY WEEK
  • 43. Data volume under control 2014-09-24 2014-09-25 2014-09-26 TODAY WEEK
  • 51. Here comes Logstash Unstructured
  • 52. Here comes Logstash Unstructured
  • 53. Here comes Logstash Unstructured Documents
  • 54. Processing example 127.0.0.1 - - [05/Feb/2014:17:11:55 +0000] "GET /css/main.css HTTP/1.1" 200 140 "http://www.onet.pl" "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
  • 55. Processing example 127.0.0.1 - - [05/Feb/2014:17:11:55 +0000] "GET /css/main.css HTTP/1.1" 200 140 "http://www.onet.pl" "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
  • 56. Processing example 127.0.0.1 - - [05/Feb/2014:17:11:55 +0000] "GET /css/main.css HTTP/1.1" 200 140 "http://www.onet.pl" "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" { "host" : "127.0.0.1", "@timestamp" : "2014-02-05T17:11:55+0000", ... "verb" : "GET" }
  • 57. How does it look?
  • 58. Of course you can scale
  • 59. Logstash input input { file { path => "/var/log/apache/apache.log" type => "access_apache_log" start_position => "beginning" } }
  • 60. Grok filter { if [type] == "access_apache_log" { grok { match => { "message" => "%{COMBINEDAPACHELOG}" } } } }
  • 61. Logstash output output { elasticsearch { host => "localhost" port => 9200 index => "logs_%{+YYYY.MM.dd}" protocol => "http" manage_template => true } }
  • 62. Sample Logstash-forwarder config { "network": { "servers": [ "localhost:5043" ], "timeout": 15 }, "files": [ { "paths": [ "/var/log/apache/apache*.log" ], "fields": { "type": "access_apache_log" } } ] }
  • 63. Sample Logstash-forwarder config { "network": { "servers": [ "localhost:5043" ], "timeout": 15 }, "files": [ { "paths": [ "/var/log/apache/apache*.log" ], "fields": { "type": "access_apache_log" } } ] } Logstash side: input { lumberjack { port => 5043 type => "access_apache_log" } }
  • 64. Let’s try it $ bin/logstash –f logstash-filter.conf
  • 65. Let’s try it $ bin/logstash –f logstash-filter.conf $ curl 'localhost:9200/logs_2014-09-26/_search?pretty'
  • 66. Let’s try it $ bin/logstash –f logstash-filter.conf $ curl 'localhost:9200/logs_2014-09-26/_search?pretty' { "took" : 3, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 }, "hits" : { "total" : 3, "max_score" : 1.0, "hits" : [ { "_index" : "logs", "_type" : "access_apache_log", "_id" : "SI0BZw8BQ0uQNPtk9zfoOQ", "_score" : 1.0, "_source":{"message":"71.141.244.242 - kurt [18/May/2011:01:48:10 -0700] "GET /admin HTTP/1.1" 301 566 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"","@version":"1","@timestamp":"2014-09-11T10:21:04.403Z","type":"access_apache_log","host":"developer-vb","path":"/home/gro/devops/apache3.log","clientip":"71.141.244.242","ident":"- ","auth":"kurt","timestamp":"18/May/2011:01:48:10 -0700","verb":"GET","request":"/admin","httpversion":"1.1","response":"301","bytes":"566","referrer":""-"","agent":""Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3""} }, { "_index" : "logs", "_type" : "access_apache_log", "_id" : "zyOc53uwQkegOQr-a3hwIQ", "_score" : 1.0, "_source":{"message":"98.83.179.51 - - [18/May/2011:19:35:08 -0700] "GET /css/main.css HTTP/1.1" 200 1837 "http://www.safesand.com/information.htm" "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"","@version":"1","@timestamp":"2014-09-11T10:21:04.405Z","type":"access_apache_log","host":"developer- vb","path":"/home/gro/devops/apache3.log","clientip":"98.83.179.51","ident":"-","auth":"-","timestamp":"18/May/2011:19:35:08 - 0700","verb":"GET","request":"/css/main.css","httpversion":"1.1","response":"200","bytes":"1837","referrer":""http://www.safesand.com/information.htm"","agent":""Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1""} }, { "_index" : "logs", "_type" : "access_apache_log", "_id" : "evP0I--3TWOlDsQzalQtAw", "_score" : 1.0, "_source":{"message":"134.39.72.245 - - [18/May/2011:12:40:18 -0700] "GET /favicon.ico HTTP/1.1" 200 1189 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E)"","@version":"1","@timestamp":"2014-09-11T10:21:04.404Z","type":"access_apache_log","host":"developer- vb","path":"/home/gro/devops/apache3.log","clientip":"134.39.72.245","ident":"-","auth":"-","timestamp":"18/May/2011:12:40:18 - 0700","verb":"GET","request":"/favicon.ico","httpversion":"1.1","response":"200","bytes":"1189","referrer":""-"","agent":""Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E)""} } ] } }
  • 68. Looking for SaaS – Go Logsene http://sematext.com/logsene
  • 69. Looking for SaaS – Go Logsene http://sematext.com/logsene
  • 70. Logstash + Logsene in action output { elasticsearch { host => "logsene-receiver.sematext.com" port => 80 index => "YOUR_TOKEN" protocol => "http" manage_template => false } } http://sematext.com/logsene
  • 72. We Are Hiring ! Dig Search ? Dig Analytics ? Dig Big Data ? Dig Performance ? Dig Logging ? Dig working with and in open – source ? We’re hiring world – wide ! http://sematext.com/about/jobs.html
  • 73. Rafał Kuć @kucrafal rafal.kuc@sematext.com Sematext @sematext http://sematext.com http://blog.sematext.com Thank You !