SlideShare a Scribd company logo
Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann
Unravelling Logs
Matt Jarvis - Head of Cloud Computing @ DataCentred
Traditional log file analysis ...
● Troubleshooting
● Post incident forensics
● Security auditing
● Reporting and analysis
Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann
Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann
Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann
Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann
Nova Controller :
● nova-api.log
● nova-cert.log
● nova-conductor.log
● nova-scheduler.log
Glance Server :
● api.log
● image-cache.log
● registry.log
Neutron Controller :
● openvswitch-agent.log
● server.log
Network Node :
● openvswitch-agent.log
● neutron-ns-metadata-proxy*.log
● metadata-agent.log
● dhcp-agent.log
Compute Node :
● openvswitch-agent.log
● nova-compute.log
● INGEST CENTRALLY
● STRUCTURE
● INDEX
● ANALYZE
Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann
Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann
● Distributed search engine
● Highly scalable
● Super fast
● HTTP interface
FIXME Kibana screenshot
● Collect
● Parse
● Transform
Log Shipping
● Lightweight log shipper
● Written in GO
● Minimal resource usage
● SSL
● Transformation capabilities
Log Courier
{
"general": {
"log file": "/var/log/log-courier.log",
"admin enabled": true
},
"network": {
"transport": "tls",
"servers": [
"your.logstash.server:55516"
],
"ssl certificate": "/var/lib/puppet/ssl/certs/yourcert.pem",
"ssl key": "/var/lib/puppet/ssl/private_keys/yourkey.pem",
"ssl ca": "/var/lib/puppet/ssl/certs/ca.pem",
"timeout": 40
},
"files": [
{
"paths": [
"/var/log/syslog"
],
"fields": {
"shipper": "log-courier",
"type": "syslog"
}
},
]
input {
courier {
port => 55516
ssl_verify => true
ssl_verify_ca => "/var/lib/puppet/ssl/certs/ca.pem"
ssl_certificate => "/var/lib/puppet/ssl/certs/yourcert.pem"
ssl_key => "/var/lib/puppet/ssl/private_keys/yourkey.pem"
type => "log-courier"
}
}
filter {
if [type] == "syslog" {
if [message] =~ /Registrar received .* event/ {
drop {}
}
grok {
match => [ "message", "<%{POSINT:syslog_pri}>%{SYSLOGTIMESTAMP:syslog_timestamp} %
{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:[%{POSINT:syslog_pid}])?: %{GREEDYDATA:
syslog_message}" ]
match => [ "message", "<%{POSINT:syslog_pri}>%{SYSLOGTIMESTAMP:syslog_timestamp} %
{SYSLOGHOST:syslog_hostname} %{YEAR}[/-]%{MONTHNUM}[/-]%{MONTHDAY} %{TIME} %{POSINT:
syslog_pid} %{WORD:severity} %{GREEDYDATA:syslog_message}"]
match => [ "message", "<%{POSINT:syslog_pri}>%{SYSLOGTIMESTAMP:syslog_timestamp} %
{SYSLOGHOST:syslog_hostname} %{YEAR}[/-]%{MONTHNUM}[/-]%{MONTHDAY} %{TIME} %{POSINT:
syslog_pid} %{WORD:severity} %{GREEDYDATA:syslog_message}"]
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
add_field => [ "program", "%{syslog_program}" ]
add_field => [ "timestamp", "%{syslog_timestamp}" ]
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}
filter {
if [type] == "native_syslog" {
grok {
match => [ "message", "%{SYSLOGLINE}" ]
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}
filter {
# Add in group tags we didn't add in forwarder due to bug
# https://github.com/elasticsearch/logstash-forwarder/issues/65
# By grouping the logs using tags we can then search all the related logs in kibana
if [type] =~ /cinder.*/ {
mutate {
add_tag => [ "cinder", "oslofmt" ]
}
}
}
output {
elasticsearch {
host => elasticsearch
embedded => false
protocol => http
}
}
output {
if [type] == "syslog" {
riemann {
riemann_event => {
"description" => "%{syslog_message}"
"service" => "%{syslog_program}"
"state" => "%{syslog_severity_code}"
}
}
}
}
FILTER
aggregate
alter
anonymize
collate
csv
cidr
clone
cipher
checksum
date
de_dot
dns
drop
elasticsearch
extractnumbers
environment
elapsed
fingerprint
geoip
grok
i18n
json
json_encode
kv
mutate
metrics
multiline
metaevent
prune
punct
ruby
range
syslog_pri
sleep
split
throttle
translate
uuid
urldecode
useragent
xml
zeromq
INPUT
beats
couchdb_changes
drupal_dblog
elasticsearch
exec
eventlog
file
ganglia
gelf
generator
graphite
github
heartbeat
heroku
http
http_poller
irc
imap
jdbc
jmx
kafka
log4j
lumberjack
meetup
pipe
puppet_facter
relp
rss
rackspace
rabbitmq
redis
salesforce
snmptrap
stdin
sqlite
s3
sqs
stomp
syslog
tcp
twitter
unix
udp
varnishlog
wmi
websocket
xmpp
zenoss
zeromq
OUTPUT
boundary
circonus
csv
cloudwatch
datadog
datadog_metrics
email
elasticsearch
elasticsearch_java
exec
file
google_bigquery
google_cloud_storage
ganglia
gelf
graphtastic
graphite
hipchat
http
irc
influxdb
juggernaut
jira
kafka
lumberjack
librato
loggly
mongodb
metriccatcher
nagios
null
nagios_nsca
opentsdb
pagerduty
pipe
riemann
redmine
rackspace
rabbitmq
redis
riak
s3
sqs
stomp
statsd
solr_http
sns
syslog
stdout
tcp
udp
webhdfs
websocket
xmpp
zabbix
zeromq
Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann
Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann
Riemann - an event stream processor
● very low latency
● extensive Clojure API
● API can also be extended with Java
(streams
(where (and (service #"^riak")
(state "critical"))
(email "delacroix@vonbraun.com")))
(by [:host :service])
(by [:host :service]
(changed :state
(rollup 5 3600
(email "delacroix@vonbraun.com"))))
(use 'clojure.java.io)
(defn get_messages [filename]
(with-open [rdr (reader filename)]
(doall (line-seq rdr))))
(def messages (get_messages "/etc/riemann.conf.d/riemann.whitelist"))
(def whitelist_pattern
(str "^((?!(" (clojure.string/join "|" messages) ")).)*$"))
(def email(mailer { :from "riemann@core.sal01.datacentred.co.uk" }))
(streams
(by :service
(where (or (state "2")(state "1")(state "0"))
(where (description (re-pattern whitelist_pattern))
(rollup 3 3600
(email "sysmail@core.sal01.datacentred.co.uk" ))))))
Ignoring invalid UTF-8 byte sequences in data to be sent to PuppetDB
tftp: client does not accept options
DHCP packet received on [a-zA-Z0-9-_]+ which has no address
Can't create new lease file: Permission denied
[-] Authorization failed. The request you have made requires authentication. from 127.0.0.1
[-] [instance: [a-zA-Z0-9-]+] Instance not resizing[,] skipping migration.
^.*dhcp-failover rejected: incoming update is less critical than outgoing update$
^.*Please use the the default quota class for default quota.$
^.*FAILED: Has an address record but no DHCID, not mine.$
^.*Found d+ in the database and d+ on the hypervisor.$
^.*Arguments dropped when creating context.*
^.*Failed to inspect.*of instance.*domain is in state of SHUTOFF
^.*Unknown base file: /var/lib/nova/instances/_base/*
^.*Couldn't obtain IP address of instance.*
[*] IPMI message handler: BMC returned incorrect response, expected*
[-] While synchronizing instance power states, found d+ instances in the database and d+ instances
on the hypervisor
(use 'clojure.java.io)
(defn get_messages [filename]
(with-open [rdr (reader filename)]
(doall (line-seq rdr))))
(def messages (get_messages "/etc/riemann.conf.d/riemann.blacklist"))
(def blacklist_pattern
(str "^?(" (clojure.string/join "|" messages) ").*$"))
(def pd (pagerduty "pagerduty_api_key"))
(streams
(by :host
(where (description (re-pattern blacklist_pattern))
(with {:state "Failure" :service "Hardware"}
(throttle 1 43200
#(info %)
(:trigger pd))))))
EDAC MCd+: d+ CE error on CPU#d+Channel#d+_DIMM#d+.*
atad+.d+: exception.*
atad+.d+: failed command:.*
atad+: link is slow to respond, please be patient.*
atad+.d+:.*failed.*
Log files
log courier
logstash
elasticsearch
riemann
kibana
pagerduty
email
Thanks for Listening !

More Related Content

What's hot (20)

PPTX
Infrastructural challenges of a fast-pace startup
DevOps Braga
 
PDF
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Publicis Sapient Engineering
 
PPTX
MongoDB - External Authentication
Jason Terpko
 
PDF
Docker Logging and analysing with Elastic Stack
Jakub Hajek
 
PDF
Scaling 100PB Data Warehouse in Cloud
Changshu Liu
 
PPTX
Elk stack
Jilles van Gurp
 
PPTX
Automating Zabbix with Puppet (Werner Dijkerman / 26-11-2015)
Nederlandstalige Zabbix Gebruikersgroep
 
PDF
OSMC 2021 | ITSM by Asterix and friends
NETWAYS
 
PDF
SCaLE 2016 - syslog-ng: From Raw Data to Big Data
BalaBit
 
KEY
Building Scalable, Distributed Job Queues with Redis and Redis::Client
Mike Friedman
 
PDF
Data Analytics Service Company and Its Ruby Usage
SATOSHI TAGOMORI
 
PDF
MongoDB .local Paris 2020: Adéo @MongoDB : MongoDB Atlas & Leroy Merlin : et ...
MongoDB
 
PPTX
Akamai Edge: Tracking the Performance of the Web with HTTP Archive
Rick Viscomi
 
PDF
OSMC 2011 | Case Study - Icinga at Hyves.nl by Jeffrey Lensen
NETWAYS
 
PDF
RedisConf18 - Redis and Elasticsearch
Redis Labs
 
PDF
LogStash in action
Manuj Aggarwal
 
PDF
2020-02-20 - HashiTalks 2020 - HashiCorp Vault configuration as code via Hash...
Andrey Devyatkin
 
PDF
Docker Monitoring Webinar
Sematext Group, Inc.
 
PPTX
Logs management
Mantas Klasavicius
 
PPT
'Scalable Logging and Analytics with LogStash'
Cloud Elements
 
Infrastructural challenges of a fast-pace startup
DevOps Braga
 
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Publicis Sapient Engineering
 
MongoDB - External Authentication
Jason Terpko
 
Docker Logging and analysing with Elastic Stack
Jakub Hajek
 
Scaling 100PB Data Warehouse in Cloud
Changshu Liu
 
Elk stack
Jilles van Gurp
 
Automating Zabbix with Puppet (Werner Dijkerman / 26-11-2015)
Nederlandstalige Zabbix Gebruikersgroep
 
OSMC 2021 | ITSM by Asterix and friends
NETWAYS
 
SCaLE 2016 - syslog-ng: From Raw Data to Big Data
BalaBit
 
Building Scalable, Distributed Job Queues with Redis and Redis::Client
Mike Friedman
 
Data Analytics Service Company and Its Ruby Usage
SATOSHI TAGOMORI
 
MongoDB .local Paris 2020: Adéo @MongoDB : MongoDB Atlas & Leroy Merlin : et ...
MongoDB
 
Akamai Edge: Tracking the Performance of the Web with HTTP Archive
Rick Viscomi
 
OSMC 2011 | Case Study - Icinga at Hyves.nl by Jeffrey Lensen
NETWAYS
 
RedisConf18 - Redis and Elasticsearch
Redis Labs
 
LogStash in action
Manuj Aggarwal
 
2020-02-20 - HashiTalks 2020 - HashiCorp Vault configuration as code via Hash...
Andrey Devyatkin
 
Docker Monitoring Webinar
Sematext Group, Inc.
 
Logs management
Mantas Klasavicius
 
'Scalable Logging and Analytics with LogStash'
Cloud Elements
 

Similar to Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann (20)

PDF
Puppet Deployment at OnApp
Puppet
 
PDF
PuppetCamp SEA 1 - Puppet Deployment at OnApp
OlinData
 
PDF
PuppetCamp SEA 1 - Puppet Deployment at OnApp
Walter Heck
 
PDF
Dave Williams - Nagios Log Server - Practical Experience
Nagios
 
PDF
Systems Automation with Puppet
elliando dias
 
PDF
Puppet at Bazaarvoice
Puppet
 
PDF
Fluentd unified logging layer
Kiyoto Tamura
 
PDF
Distributed monitoring at Hyves- Puppet
Puppet
 
PPTX
Centralized log-management-with-elastic-stack
Rich Lee
 
PPTX
Puppet atbazaarvoice
Dave Barcelo
 
PPT
ELK stack at weibo.com
琛琳 饶
 
PDF
Puppet modules: An Holistic Approach
Alessandro Franceschi
 
PDF
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet
 
PPT
Logstash
琛琳 饶
 
PPTX
Search and analyze data in real time
Rohit Kalsarpe
 
PDF
Monitoring&Logging - Stanislav Kolenkin
Kuberton
 
PDF
20090514 Introducing Puppet To Sasag
garrett honeycutt
 
PDF
Continuous deployment of puppet modules
William O'Neill
 
PDF
Take control of your dev ops dumping ground
Puppet
 
ODP
Making a Robust Installer for Linux Server Applications with Puppet Modules
Puppet
 
Puppet Deployment at OnApp
Puppet
 
PuppetCamp SEA 1 - Puppet Deployment at OnApp
OlinData
 
PuppetCamp SEA 1 - Puppet Deployment at OnApp
Walter Heck
 
Dave Williams - Nagios Log Server - Practical Experience
Nagios
 
Systems Automation with Puppet
elliando dias
 
Puppet at Bazaarvoice
Puppet
 
Fluentd unified logging layer
Kiyoto Tamura
 
Distributed monitoring at Hyves- Puppet
Puppet
 
Centralized log-management-with-elastic-stack
Rich Lee
 
Puppet atbazaarvoice
Dave Barcelo
 
ELK stack at weibo.com
琛琳 饶
 
Puppet modules: An Holistic Approach
Alessandro Franceschi
 
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet
 
Logstash
琛琳 饶
 
Search and analyze data in real time
Rohit Kalsarpe
 
Monitoring&Logging - Stanislav Kolenkin
Kuberton
 
20090514 Introducing Puppet To Sasag
garrett honeycutt
 
Continuous deployment of puppet modules
William O'Neill
 
Take control of your dev ops dumping ground
Puppet
 
Making a Robust Installer for Linux Server Applications with Puppet Modules
Puppet
 
Ad

Recently uploaded (20)

PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Tally software_Introduction_Presentation
AditiBansal54083
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Ad

Matt Jarvis - Unravelling Logs: Log Processing with Logstash and Riemann