Slide 1

Slide 1 text

Handling Emergency Response with Logstash Abubakar Siddiq Ango @sarki247

Slide 2

Slide 2 text

About Me Social Entrepreneur, building the community in Bauchi, Nigeria. Support Engineer @ GitLab (We’re hiring!!!, visit https://about.gitlab.com/jobs) I do DevOps, CI/CD, Kubernetes & Cloud native You can find my at https://abuango.me & twitter.com/sarki247

Slide 3

Slide 3 text

Oh No!!!

Slide 4

Slide 4 text

Logs come to the rescue ...but seriously, all those lines!

Slide 5

Slide 5 text

ELK stack is your new bff

Slide 6

Slide 6 text

logstash

Slide 7

Slide 7 text

Components of logstash

Slide 8

Slide 8 text

Using Logstash - Download or Install Logstash - Download Binary files - Install OS Packages - Create a config file - Setup plugins - Setup necessary services

Slide 9

Slide 9 text

Config file # This is a comment. You should use comments to describe # parts of your configuration. input { ... } filter { ... } output { ... }

Slide 10

Slide 10 text

Demo - Parse Apache Access Logs - Send slack notification for 4xx responses - Trigger PagerDuty for 5xx responses

Slide 11

Slide 11 text

Demo - input input { file { path => "/var/log/apache2/access.log" type => "logs" } }

Slide 12

Slide 12 text

DEMO - FILTER filter { grok { match => { "message" => "%{COMBINEDAPACHELOG}" } } }

Slide 13

Slide 13 text

DEMO - OUTPUT output { stdout { codec => json } if [response] =~ /^5\d\d/ { pagerduty { event_type => "trigger" description => "%{host} - Internal Server Error - %{response}" details => { timestamp => "%{timestamp}" message => "%{message}" } service_key => "721f938726c64-xxxxxxxx" incident_key => "logstash/%{host}/%{type}" } } else if [response] =~ /^4\d\d/ { slack { url => "https://hooks.slack.com/services/T9A5C-xxxx/BC8TQ-xxxxx/M6ByQuyOwt-xxxxxxxxxx" username => "abuango" channel => "abuango" format => "400 - File not found Error ==> %{message}" } } }

Slide 14

Slide 14 text

Questions?

Slide 15

Slide 15 text

Thank you :)