SlideShare ist ein Scribd-Unternehmen logo
1 von 73
Downloaden Sie, um offline zu lesen
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 !

Weitere ähnliche Inhalte

Was ist angesagt?

Scaling Massive Elasticsearch Clusters
Scaling Massive Elasticsearch ClustersScaling Massive Elasticsearch Clusters
Scaling Massive Elasticsearch ClustersSematext Group, Inc.
 
Solr and Elasticsearch, a performance study
Solr and Elasticsearch, a performance studySolr and Elasticsearch, a performance study
Solr and Elasticsearch, a performance studyCharlie Hull
 
Workshop: Learning Elasticsearch
Workshop: Learning ElasticsearchWorkshop: Learning Elasticsearch
Workshop: Learning ElasticsearchAnurag Patel
 
Elasticsearch - Dynamic Nodes
Elasticsearch - Dynamic NodesElasticsearch - Dynamic Nodes
Elasticsearch - Dynamic NodesScott Davis
 
ElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersBen van Mol
 
ElasticSearch AJUG 2013
ElasticSearch AJUG 2013ElasticSearch AJUG 2013
ElasticSearch AJUG 2013Roy Russo
 
ElasticSearch in action
ElasticSearch in actionElasticSearch in action
ElasticSearch in actionCodemotion
 
Side by Side with Elasticsearch & Solr, Part 2
Side by Side with Elasticsearch & Solr, Part 2Side by Side with Elasticsearch & Solr, Part 2
Side by Side with Elasticsearch & Solr, Part 2Sematext Group, Inc.
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화NAVER D2
 
Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Karel Minarik
 
Query DSL In Elasticsearch
Query DSL In ElasticsearchQuery DSL In Elasticsearch
Query DSL In ElasticsearchKnoldus Inc.
 
Solr Search Engine: Optimize Is (Not) Bad for You
Solr Search Engine: Optimize Is (Not) Bad for YouSolr Search Engine: Optimize Is (Not) Bad for You
Solr Search Engine: Optimize Is (Not) Bad for YouSematext Group, Inc.
 
Introduction to Apache Solr
Introduction to Apache SolrIntroduction to Apache Solr
Introduction to Apache SolrChristos Manios
 
Apache Solr/Lucene Internals by Anatoliy Sokolenko
Apache Solr/Lucene Internals  by Anatoliy SokolenkoApache Solr/Lucene Internals  by Anatoliy Sokolenko
Apache Solr/Lucene Internals by Anatoliy SokolenkoProvectus
 
Side by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and SolrSide by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and SolrSematext Group, Inc.
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchRuslan Zavacky
 
Elasticsearch Basics
Elasticsearch BasicsElasticsearch Basics
Elasticsearch BasicsShifa Khan
 
Lucene Introduction
Lucene IntroductionLucene Introduction
Lucene Introductionotisg
 

Was ist angesagt? (19)

Scaling Massive Elasticsearch Clusters
Scaling Massive Elasticsearch ClustersScaling Massive Elasticsearch Clusters
Scaling Massive Elasticsearch Clusters
 
Solr and Elasticsearch, a performance study
Solr and Elasticsearch, a performance studySolr and Elasticsearch, a performance study
Solr and Elasticsearch, a performance study
 
Workshop: Learning Elasticsearch
Workshop: Learning ElasticsearchWorkshop: Learning Elasticsearch
Workshop: Learning Elasticsearch
 
Elasticsearch - Dynamic Nodes
Elasticsearch - Dynamic NodesElasticsearch - Dynamic Nodes
Elasticsearch - Dynamic Nodes
 
ElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersElasticSearch for .NET Developers
ElasticSearch for .NET Developers
 
ElasticSearch AJUG 2013
ElasticSearch AJUG 2013ElasticSearch AJUG 2013
ElasticSearch AJUG 2013
 
ElasticSearch in action
ElasticSearch in actionElasticSearch in action
ElasticSearch in action
 
Side by Side with Elasticsearch & Solr, Part 2
Side by Side with Elasticsearch & Solr, Part 2Side by Side with Elasticsearch & Solr, Part 2
Side by Side with Elasticsearch & Solr, Part 2
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화
 
Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)
 
Query DSL In Elasticsearch
Query DSL In ElasticsearchQuery DSL In Elasticsearch
Query DSL In Elasticsearch
 
Solr Search Engine: Optimize Is (Not) Bad for You
Solr Search Engine: Optimize Is (Not) Bad for YouSolr Search Engine: Optimize Is (Not) Bad for You
Solr Search Engine: Optimize Is (Not) Bad for You
 
Introduction to Apache Solr
Introduction to Apache SolrIntroduction to Apache Solr
Introduction to Apache Solr
 
High Performance Solr
High Performance SolrHigh Performance Solr
High Performance Solr
 
Apache Solr/Lucene Internals by Anatoliy Sokolenko
Apache Solr/Lucene Internals  by Anatoliy SokolenkoApache Solr/Lucene Internals  by Anatoliy Sokolenko
Apache Solr/Lucene Internals by Anatoliy Sokolenko
 
Side by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and SolrSide by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and Solr
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
Elasticsearch Basics
Elasticsearch BasicsElasticsearch Basics
Elasticsearch Basics
 
Lucene Introduction
Lucene IntroductionLucene Introduction
Lucene Introduction
 

Andere mochten auch

Tuning Elasticsearch Indexing Pipeline for Logs
Tuning Elasticsearch Indexing Pipeline for LogsTuning Elasticsearch Indexing Pipeline for Logs
Tuning Elasticsearch Indexing Pipeline for LogsSematext Group, Inc.
 
Administering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud ClustersAdministering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud ClustersRafał Kuć
 
Solr Anti - patterns
Solr Anti - patternsSolr Anti - patterns
Solr Anti - patternsRafał Kuć
 
PLNOG 18 - Dr Marek Michalewicz - InfiniCortex: Superkomputer wielki jak świat
PLNOG 18 - Dr Marek Michalewicz - InfiniCortex: Superkomputer wielki jak światPLNOG 18 - Dr Marek Michalewicz - InfiniCortex: Superkomputer wielki jak świat
PLNOG 18 - Dr Marek Michalewicz - InfiniCortex: Superkomputer wielki jak światPROIDEA
 
Elasticsearch Data Analyses
Elasticsearch Data AnalysesElasticsearch Data Analyses
Elasticsearch Data AnalysesAlaa Elhadba
 
Ansible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań ITAnsible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań ITKamil Grabowski
 
Building Resilient Log Aggregation Pipeline with Elasticsearch & Kafka
Building Resilient Log Aggregation Pipeline with Elasticsearch & KafkaBuilding Resilient Log Aggregation Pipeline with Elasticsearch & Kafka
Building Resilient Log Aggregation Pipeline with Elasticsearch & KafkaSematext Group, Inc.
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerSematext Group, Inc.
 
Elasticsearch in Zalando
Elasticsearch in ZalandoElasticsearch in Zalando
Elasticsearch in ZalandoAlaa Elhadba
 
2013_Expanded_Employment_Law_Update_New_Developments_and_Trends
2013_Expanded_Employment_Law_Update_New_Developments_and_Trends2013_Expanded_Employment_Law_Update_New_Developments_and_Trends
2013_Expanded_Employment_Law_Update_New_Developments_and_TrendsParsons Behle & Latimer
 
Communication skills (1)
Communication skills (1)Communication skills (1)
Communication skills (1)ehab elbaz
 
사진 앨범
사진 앨범사진 앨범
사진 앨범net4you
 
MyRingCard #bigliettodavisitaelettronico
MyRingCard #bigliettodavisitaelettronicoMyRingCard #bigliettodavisitaelettronico
MyRingCard #bigliettodavisitaelettronicoFrancesco Pieragostini
 
致明天的我们 20120606
致明天的我们 20120606致明天的我们 20120606
致明天的我们 20120606cash0430
 
To Compete or Not Compete? That is the Legislation
To Compete or Not Compete? That is the LegislationTo Compete or Not Compete? That is the Legislation
To Compete or Not Compete? That is the LegislationParsons Behle & Latimer
 
Freelance Workshop Lecture 2
Freelance Workshop Lecture 2Freelance Workshop Lecture 2
Freelance Workshop Lecture 2Kareem Elzftawy
 

Andere mochten auch (20)

Tuning Elasticsearch Indexing Pipeline for Logs
Tuning Elasticsearch Indexing Pipeline for LogsTuning Elasticsearch Indexing Pipeline for Logs
Tuning Elasticsearch Indexing Pipeline for Logs
 
Administering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud ClustersAdministering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud Clusters
 
Solr Anti - patterns
Solr Anti - patternsSolr Anti - patterns
Solr Anti - patterns
 
PLNOG 18 - Dr Marek Michalewicz - InfiniCortex: Superkomputer wielki jak świat
PLNOG 18 - Dr Marek Michalewicz - InfiniCortex: Superkomputer wielki jak światPLNOG 18 - Dr Marek Michalewicz - InfiniCortex: Superkomputer wielki jak świat
PLNOG 18 - Dr Marek Michalewicz - InfiniCortex: Superkomputer wielki jak świat
 
Elasticsearch Data Analyses
Elasticsearch Data AnalysesElasticsearch Data Analyses
Elasticsearch Data Analyses
 
Ansible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań ITAnsible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań IT
 
Docker up and running
Docker up and runningDocker up and running
Docker up and running
 
How to Run Solr on Docker and Why
How to Run Solr on Docker and WhyHow to Run Solr on Docker and Why
How to Run Solr on Docker and Why
 
Building Resilient Log Aggregation Pipeline with Elasticsearch & Kafka
Building Resilient Log Aggregation Pipeline with Elasticsearch & KafkaBuilding Resilient Log Aggregation Pipeline with Elasticsearch & Kafka
Building Resilient Log Aggregation Pipeline with Elasticsearch & Kafka
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
 
Elasticsearch in Zalando
Elasticsearch in ZalandoElasticsearch in Zalando
Elasticsearch in Zalando
 
2013_Expanded_Employment_Law_Update_New_Developments_and_Trends
2013_Expanded_Employment_Law_Update_New_Developments_and_Trends2013_Expanded_Employment_Law_Update_New_Developments_and_Trends
2013_Expanded_Employment_Law_Update_New_Developments_and_Trends
 
World crimes
World crimesWorld crimes
World crimes
 
Doma natural: Esteban Labari i Lucy Rees
Doma natural: Esteban Labari i Lucy ReesDoma natural: Esteban Labari i Lucy Rees
Doma natural: Esteban Labari i Lucy Rees
 
Communication skills (1)
Communication skills (1)Communication skills (1)
Communication skills (1)
 
사진 앨범
사진 앨범사진 앨범
사진 앨범
 
MyRingCard #bigliettodavisitaelettronico
MyRingCard #bigliettodavisitaelettronicoMyRingCard #bigliettodavisitaelettronico
MyRingCard #bigliettodavisitaelettronico
 
致明天的我们 20120606
致明天的我们 20120606致明天的我们 20120606
致明天的我们 20120606
 
To Compete or Not Compete? That is the Legislation
To Compete or Not Compete? That is the LegislationTo Compete or Not Compete? That is the Legislation
To Compete or Not Compete? That is the Legislation
 
Freelance Workshop Lecture 2
Freelance Workshop Lecture 2Freelance Workshop Lecture 2
Freelance Workshop Lecture 2
 

Ähnlich wie From zero to hero - Easy log centralization with Logstash and Elasticsearch

(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014Amazon Web Services
 
20190516 web security-basic
20190516 web security-basic20190516 web security-basic
20190516 web security-basicMksYi
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyChristian Thilmany
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariJoseph Scott
 
Logstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeLogstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeAndrea Cardinale
 
Composing re-useable ETL on Hadoop
Composing re-useable ETL on HadoopComposing re-useable ETL on Hadoop
Composing re-useable ETL on HadoopPaul Lam
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek PROIDEA
 
Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackJakub Hajek
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...Aman Kohli
 
Whatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processWhatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processguest3379bd
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaPrajal Kulkarni
 
Elk its big log season
Elk its big log seasonElk its big log season
Elk its big log seasonEric Luellen
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindSam Keen
 
Synapseindia dot net development web applications with ajax
Synapseindia dot net development  web applications with ajaxSynapseindia dot net development  web applications with ajax
Synapseindia dot net development web applications with ajaxSynapseindiappsdevelopment
 

Ähnlich wie From zero to hero - Easy log centralization with Logstash and Elasticsearch (20)

(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
 
20190516 web security-basic
20190516 web security-basic20190516 web security-basic
20190516 web security-basic
 
Revoke-Obfuscation
Revoke-ObfuscationRevoke-Obfuscation
Revoke-Obfuscation
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Logstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeLogstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtime
 
gofortution
gofortutiongofortution
gofortution
 
Composing re-useable ETL on Hadoop
Composing re-useable ETL on HadoopComposing re-useable ETL on Hadoop
Composing re-useable ETL on Hadoop
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek
 
Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic Stack
 
Logstash
LogstashLogstash
Logstash
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
 
Whatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processWhatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the process
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
Elk its big log season
Elk its big log seasonElk its big log season
Elk its big log season
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
Synapseindia dot net development web applications with ajax
Synapseindia dot net development  web applications with ajaxSynapseindia dot net development  web applications with ajax
Synapseindia dot net development web applications with ajax
 
Romulus OWASP
Romulus OWASPRomulus OWASP
Romulus OWASP
 
The Devil and HTML5
The Devil and HTML5The Devil and HTML5
The Devil and HTML5
 

Kürzlich hochgeladen

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 

Kürzlich hochgeladen (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 

From zero to hero - Easy log centralization with Logstash and 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 !