elk scilifelab

41
ELK Stack Because logs are not meant to go to /dev/null Guillermo Carrasco @guillemch

Upload: guillermo-carrasco-hernandez

Post on 24-May-2015

414 views

Category:

Engineering


6 download

DESCRIPTION

Presentation given on 2014-09-22 at Science For Life Laboratory in Stockholm, Sweden, about ELK stack.

TRANSCRIPT

Page 1: Elk scilifelab

ELK StackBecause logs are not meant to go to /dev/null

Guillermo Carrasco @guillemch

Page 2: Elk scilifelab

Logging & ELK stack

Page 3: Elk scilifelab

Logging & ELK stack

What are logs?

What are logs for? Theory vs reality

Logstash & Elasticsearch

Kibana

Page 4: Elk scilifelab

What are logs?

http://adam.herokuapp.com/past/2011/4/1/logs_are_streams_not_files/

Page 5: Elk scilifelab

What are logs?

http://adam.herokuapp.com/past/2011/4/1/logs_are_streams_not_files/

2014-09-19 13:08:37,972 INFO [MiSeqIntegrator] (SequencingIntegrationUtil)

Extracted raw content - [cycleNumber = 308 , runFolder = "D:\Illumina\MiSeqTemp\140904_M01320_0130_000000000-A9NE9" , netFolder = "Z:\140904_M01320_0130_000000000-A9NE9" ,

Record

Page 6: Elk scilifelab

What are logs?

http://adam.herokuapp.com/past/2011/4/1/logs_are_streams_not_files/

2014-09-19 13:08:37,972 INFO [MiSeqIntegrator] (SequencingIntegrationUtil)

Extracted raw content - [cycleNumber = 308 , runFolder = "D:\Illumina\MiSeqTemp\140904_M01320_0130_000000000-A9NE9" , netFolder = "Z:\140904_M01320_0130_000000000-A9NE9" ,

Record

Page 7: Elk scilifelab

What are logs?

http://adam.herokuapp.com/past/2011/4/1/logs_are_streams_not_files/

2014-09-19 13:08:37,972 INFO [MiSeqIntegrator] (SequencingIntegrationUtil)

Extracted raw content - [cycleNumber = 308 , runFolder = "D:\Illumina\MiSeqTemp\140904_M01320_0130_000000000-A9NE9" , netFolder = "Z:\140904_M01320_0130_000000000-A9NE9" ,

Record

Page 8: Elk scilifelab

What are logs?

http://adam.herokuapp.com/past/2011/4/1/logs_are_streams_not_files/

2014-09-19 13:08:37,972 INFO [MiSeqIntegrator] (SequencingIntegrationUtil)

Extracted raw content - [cycleNumber = 308 , runFolder = "D:\Illumina\MiSeqTemp\140904_M01320_0130_000000000-A9NE9" , netFolder = "Z:\140904_M01320_0130_000000000-A9NE9" ,

Record

Page 9: Elk scilifelab

What are logs?

http://adam.herokuapp.com/past/2011/4/1/logs_are_streams_not_files/

2014-09-19 13:08:37,972 INFO [MiSeqIntegrator] (SequencingIntegrationUtil)

Extracted raw content - [cycleNumber = 308 , runFolder = "D:\Illumina\MiSeqTemp\140904_M01320_0130_000000000-A9NE9" , netFolder = "Z:\140904_M01320_0130_000000000-A9NE9" ,

Record

MiSeqIntegrator.logHiSeqIntegrator.log

apache.logGenStat.log

supervisord.log…

Page 10: Elk scilifelab

What are logs?

http://adam.herokuapp.com/past/2011/4/1/logs_are_streams_not_files/

2014-09-19 13:08:37,972 INFO [MiSeqIntegrator] (SequencingIntegrationUtil)

Extracted raw content - [cycleNumber = 308 , runFolder = "D:\Illumina\MiSeqTemp\140904_M01320_0130_000000000-A9NE9" , netFolder = "Z:\140904_M01320_0130_000000000-A9NE9" ,

Record

MiSeqIntegrator.logHiSeqIntegrator.log

apache.logGenStat.log

supervisord.log…

So logs are files?

Page 11: Elk scilifelab

What are logs?

- Logs are time-oriented streams of records

http://adam.herokuapp.com/past/2011/4/1/logs_are_streams_not_files/

2014-09-19 13:08:37,972 INFO [MiSeqIntegrator] (SequencingIntegrationUtil)

Extracted raw content - [cycleNumber = 308 , runFolder = "D:\Illumina\MiSeqTemp\140904_M01320_0130_000000000-A9NE9" , netFolder = "Z:\140904_M01320_0130_000000000-A9NE9" ,

Record

MiSeqIntegrator.logHiSeqIntegrator.log

apache.logGenStat.log

supervisord.log…

Page 12: Elk scilifelab

What are logs for?Theory

Page 13: Elk scilifelab

What are logs for?

Provide real-time and valuableinformation about the execution ofa program

Use this information in your benefit:prevent problems, do analytics, plotstatus…

Theory

Page 14: Elk scilifelab

Example: Our pipeline

Page 15: Elk scilifelab

Example: Our pipelinestarted job X for sample Y Aligning sample X Generating report for Project A.Sample_14_09 Cleaning /proj/a2010002/nobackup area

Page 16: Elk scilifelab

Example: Our pipelinestarted job X for sample Y Aligning sample X Generating report for Project A.Sample_14_09 Cleaning /proj/a2010002/nobackup area

Submitted jobs in the last X mins… Pipeline crashes in the last X days…

Page 17: Elk scilifelab

Example: Illumina logs

Page 18: Elk scilifelab

Example: Illumina logs

- Status of a particularrun

- Failures/Anomalies- Cycles sequenced

today/this week/etc- …

Page 19: Elk scilifelab

What are logs for?Reality

Page 20: Elk scilifelab

What are logs for?

Something we look at ONLY whensomething has already gone wrong…if we can!

Reality

Page 21: Elk scilifelab

On the previous examples…

Page 22: Elk scilifelab

On the previous examples…

- The pipeline logs are dumped tonextgen_analysis_server.log, inmilou-b, under the functionalaccount… and rotated!

- The Illumina logs are just neverlooked at…

Page 23: Elk scilifelab

Problems

Page 24: Elk scilifelab

Problems

- Logs spread around servers and accounts

- Rotating logs may disappear - If you don’t rotate, logs will fill up

disks - Hardly difficult to do any analytics

(real-time) - Different applications == different

log formats

Page 25: Elk scilifelab

Problems

Genologics support:

”I took a look at the system. Unfortunately the logs are filling up in too quick of a time. I have increased the number of logs and the size of them. We should have more that one day of logs now.”

Page 26: Elk scilifelab

Problems

rm -rf <all

_the_log

s>

Page 27: Elk scilifelab

ELK Stack !

- Elasticsearch - Logstash - Kibana

Page 28: Elk scilifelab

Logstash

Page 29: Elk scilifelab

Logstash

Index log records formdifferent sources

Re-format log data to bestructured and ”queryable"

Apply filters

Store your structured datainto Elasticsearch (andother outputs)

Page 30: Elk scilifelab

input { #Read messages from redis redis { host => "localhost" data_type => "list" password => "password" key => "python" codec => json } } !#We want to filter multiline events, and we'll suppose that multiline #events are composed by one event and the following ones starting with #a sapce (like anexception traceback) filter { multiline { type => "exception" pattern => "^\s" what => "previous" add_tag => [ "exception" ] } } !output { elasticsearch { host => "tools.scilifelab.se" } }

Page 31: Elk scilifelab

Elasticsearch

Page 32: Elk scilifelab

Elasticsearch

Built on top of Lucene

Store complex data asstructured JSON documents.All fields are indexed bydefault, and all the indicescan be used in a single query.

Schema free (good for logs)

RESTful API

Page 34: Elk scilifelab

Kibana

No code required

Real-time analysis forstreaming data

Customise and createdashboards

For freeeee!!!

Page 35: Elk scilifelab
Page 36: Elk scilifelab

Shippers

Page 37: Elk scilifelab

Shippers

Broker*

Page 38: Elk scilifelab

Shippers

Broker*

Indexer

Page 39: Elk scilifelab

Shippers

Broker*

Indexer

Storage & search

Page 40: Elk scilifelab

Shippers

Broker*

Indexer

Storage & search

Visualization

Page 41: Elk scilifelab

Thank you!