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

PPTX
Elk with Openstack
PPT
{{more}} Kibana4
PDF
OpenStack Log Mining
DOC
PPTX
MySQL Slow Query log Monitoring using Beats & ELK
PDF
Chapman: Building a High-Performance Distributed Task Service with MongoDB
PDF
Aaron Mildenstein - Using Logstash with Zabbix
PDF
Devoxx france 2015 influxdb
Elk with Openstack
{{more}} Kibana4
OpenStack Log Mining
MySQL Slow Query log Monitoring using Beats & ELK
Chapman: Building a High-Performance Distributed Task Service with MongoDB
Aaron Mildenstein - Using Logstash with Zabbix
Devoxx france 2015 influxdb

What's hot (20)

PPTX
Infrastructural challenges of a fast-pace startup
PDF
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
PPTX
MongoDB - External Authentication
PDF
Docker Logging and analysing with Elastic Stack
PDF
Scaling 100PB Data Warehouse in Cloud
PPTX
Elk stack
PPTX
Automating Zabbix with Puppet (Werner Dijkerman / 26-11-2015)
PDF
OSMC 2021 | ITSM by Asterix and friends
PDF
SCaLE 2016 - syslog-ng: From Raw Data to Big Data
KEY
Building Scalable, Distributed Job Queues with Redis and Redis::Client
PDF
Data Analytics Service Company and Its Ruby Usage
PDF
MongoDB .local Paris 2020: Adéo @MongoDB : MongoDB Atlas & Leroy Merlin : et ...
PPTX
Akamai Edge: Tracking the Performance of the Web with HTTP Archive
PDF
OSMC 2011 | Case Study - Icinga at Hyves.nl by Jeffrey Lensen
PDF
RedisConf18 - Redis and Elasticsearch
PDF
LogStash in action
PDF
2020-02-20 - HashiTalks 2020 - HashiCorp Vault configuration as code via Hash...
PDF
Docker Monitoring Webinar
PPTX
Logs management
PPT
'Scalable Logging and Analytics with LogStash'
Infrastructural challenges of a fast-pace startup
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
MongoDB - External Authentication
Docker Logging and analysing with Elastic Stack
Scaling 100PB Data Warehouse in Cloud
Elk stack
Automating Zabbix with Puppet (Werner Dijkerman / 26-11-2015)
OSMC 2021 | ITSM by Asterix and friends
SCaLE 2016 - syslog-ng: From Raw Data to Big Data
Building Scalable, Distributed Job Queues with Redis and Redis::Client
Data Analytics Service Company and Its Ruby Usage
MongoDB .local Paris 2020: Adéo @MongoDB : MongoDB Atlas & Leroy Merlin : et ...
Akamai Edge: Tracking the Performance of the Web with HTTP Archive
OSMC 2011 | Case Study - Icinga at Hyves.nl by Jeffrey Lensen
RedisConf18 - Redis and Elasticsearch
LogStash in action
2020-02-20 - HashiTalks 2020 - HashiCorp Vault configuration as code via Hash...
Docker Monitoring Webinar
Logs management
'Scalable Logging and Analytics with LogStash'
Ad

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

PDF
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PDF
Puppet Deployment at OnApp
PDF
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PDF
Dave Williams - Nagios Log Server - Practical Experience
PDF
Systems Automation with Puppet
PDF
Puppet at Bazaarvoice
PDF
Fluentd unified logging layer
PDF
Distributed monitoring at Hyves- Puppet
PPTX
Centralized log-management-with-elastic-stack
PPTX
Puppet atbazaarvoice
PPT
ELK stack at weibo.com
PDF
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
PDF
Puppet modules: An Holistic Approach
PPT
Logstash
PPTX
Search and analyze data in real time
PDF
Monitoring&Logging - Stanislav Kolenkin
PDF
20090514 Introducing Puppet To Sasag
PDF
Continuous deployment of puppet modules
PDF
Take control of your dev ops dumping ground
ODP
Making a Robust Installer for Linux Server Applications with Puppet Modules
PuppetCamp SEA 1 - Puppet Deployment at OnApp
Puppet Deployment at OnApp
PuppetCamp SEA 1 - Puppet Deployment at OnApp
Dave Williams - Nagios Log Server - Practical Experience
Systems Automation with Puppet
Puppet at Bazaarvoice
Fluentd unified logging layer
Distributed monitoring at Hyves- Puppet
Centralized log-management-with-elastic-stack
Puppet atbazaarvoice
ELK stack at weibo.com
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet modules: An Holistic Approach
Logstash
Search and analyze data in real time
Monitoring&Logging - Stanislav Kolenkin
20090514 Introducing Puppet To Sasag
Continuous deployment of puppet modules
Take control of your dev ops dumping ground
Making a Robust Installer for Linux Server Applications with Puppet Modules
Ad

Recently uploaded (20)

PPTX
history of c programming in notes for students .pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
L1 - Introduction to python Backend.pptx
PDF
System and Network Administration Chapter 2
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Introduction to Artificial Intelligence
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
top salesforce developer skills in 2025.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Digital Strategies for Manufacturing Companies
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Essential Infomation Tech presentation.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
history of c programming in notes for students .pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Operating system designcfffgfgggggggvggggggggg
L1 - Introduction to python Backend.pptx
System and Network Administration Chapter 2
Upgrade and Innovation Strategies for SAP ERP Customers
CHAPTER 2 - PM Management and IT Context
Introduction to Artificial Intelligence
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Adobe Illustrator 28.6 Crack My Vision of Vector Design
top salesforce developer skills in 2025.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Digital Strategies for Manufacturing Companies
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Odoo Companies in India – Driving Business Transformation.pdf
Essential Infomation Tech presentation.pptx
Reimagine Home Health with the Power of Agentic AI​

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