Elk devops
- 1. ELK,
a real case study
Alessandro Mazzoli
Sysadmin@Ideato
am@ideato.it
Paolo Tonin
Sysadmin@Ideato
pt@ideato.it
- 2. What is ELK stack?
Elasticsearch
Logstash
Kibana
http://en.wikipedia.org/wiki/Elk
- 7. Log As a Service?!?!
Pretty expensive
- 14. Why ELK, a case study
Web Tier
Apache
Nginx
Proxy
MySQL DB
Proxy FE Database BE
NFS shared filesystem
- 16. Why ELK, a case study
Nginx proxy LB
Apache web1 MySQL DB
Memcached,
Logstash
Web TierProxy FE Database BE
Apache web2
NFS shared filesystem
- 17. Nginx proxy LB
Apache web1 MySQL DB
Memcached,
Logstash
Web TierProxy FE Database BE
Apache web2
NFS shared filesystem
Why ELK, a case study
local log
local log
- 24. Example configuration
input {
file {
path => "/var/log/messages"
type => "syslog"
}
file {
path => "/var/log/apache/access.log"
type => “apache-access"
}
}
- 25. Example configuration
filter {
if [type] =~ "access" {
mutate {
replace => { "type" => “apache-access” }
}
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
}
date {
match => ["timestamp", "dd/MMM/yyyy:HH:mm:ss Z"] }
}
}
- 27. “How can I collect and
consult my application
Magento log?”
- 29. Grok
It’s is currently the best way
in logstash to parse crappy
unstructured log data into
something structured and
queryable
- http://logstash.net/docs/1.4.2/filters/grok
- 35. {
"_index": "logstash-2015.03.30",
"_type": "magento",
"_id": "AUxrSbc5UWx9I25Cgios",
"_score": null,
"_source": {
"message": "SoapFault exception: [soap:Client] Server
was unable to read request. ---> There is an error in XML
document (2, 435). ---> Input string was not in a correct
format. in /var/www/magento/vendor/connect20/MailUp/app/
code/local/MailUp/MailUpSync/Model/Observer.php:158",
"@version": "1",
"@timestamp": "2015-03-30T15:25:34.867Z",
"type": "magento",
"host": "web2",
"path": "/var/www/magento/var/log/exception.log",
},
}
- 38. PRO
• Easy to install
!
• Opensource
!
• Not only web logs!
!
• Many output filters; S3, Google
Big Query, MongoDb etc…
- 39. ConclusionsCONS
• Many moving parts, each part has
their problems and issues
!
• Quickly evolution, prepare
yourself to upgrade frequently
!
• Out-of-the-box configurations
are not suitable for medium/large
deployment