centralised logging with elk stack

12
Centralised Logging with ELK Credit: Pasakuru76 https://flic.kr/p/8K1iYi

Upload: simon-hanmer

Post on 10-Jan-2017

656 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Centralised logging with ELK stack

Centralised Logging

with ELK

Credit: Pasakuru76https://flic.kr/p/8K1iYi

Page 2: Centralised logging with ELK stack

[email protected] simonhanmer

# whoami• Simon Hanmer– IT Consultant– Sysadmin, Infrastructure architect,

server wrangler.

[email protected] simonhanmer

Page 3: Centralised logging with ELK stack

[email protected] simonhanmer

Why?• Lots of log files– Server– Applications–Network

• Different formats

• Multiply by many servers

Page 4: Centralised logging with ELK stack

[email protected] simonhanmer Credit: Kuhnmihttps://flic.kr/p/jbAnNa

What my brain feels like after trying to parse too many logs

Page 5: Centralised logging with ELK stack

[email protected] simonhanmer

Elasticsearch• Indexing and search engine• Near real-time• Distributed, auto-discover clustering– AWS Plugin

Page 6: Centralised logging with ELK stack

[email protected] simonhanmer

Logstash• Collects logs• Parses, extracts and formats data• Passes data to Elasticsearch

Page 7: Centralised logging with ELK stack

[email protected] simonhanmer

Logstash - examplefilter { if [file] == "/var/log/secure" and ( [syslog_message] =~ /Invalid user/ or [syslog_message] =~ /User root from/ ) { grok { add_tag => [ "LOGIN" ] match => { "syslog_message" => “user %{WORD:username} from %{IP:srcip}" } } }

}

Page 8: Centralised logging with ELK stack

[email protected] simonhanmer

Kibana• Web interface to query Elasticsearch• node.js

Page 9: Centralised logging with ELK stack

[email protected] simonhanmer

Process flow

Page 10: Centralised logging with ELK stack

[email protected] simonhanmer

AWS Architecture

Page 11: Centralised logging with ELK stack

[email protected] simonhanmer

Demo

Page 12: Centralised logging with ELK stack

[email protected] simonhanmer

What next?• elastic.co

– All components of stack available.