SlideShare uma empresa Scribd logo
1 de 54
Using ZeroMQ and
Elasticsearch for log
     aggregation

 Tomas Doran (t0m) <bobtfish@bobtfish.net>
Who are you?
• CPAN Developer
 •   Catalyst core team
 •   Moose hacker
 •   AnyEvent::RabbitMQ user
 •   Ruby/Python/C as needed
• Dayjob - deveverthingops - state51
 •   3/4 Pb of MogileFS - online music
 •   Thousands of steams a second
 •   Lots of perl.
 •   Lots of servers
 •   Lots of services
Sorry!


• This isn’t a ZeroMQ tutotial
• This isn’t an ElasticSearch tutorial
Debugging production

• Is hard!
• Especially interactions
• Need to cross-correlate logs.
Naïve solution

• “Lets log into the database”
• NO NO NO NO
• 120 lines/s (7200 disk)
• 167 lines/s (10k disk)
• 250 lines/s (15k disk)
Less naïve solution

• Queue before we log
• Bulk insert
• No good for unstructured data
• No good for many different structures
Still a stupid solution

• Lots of UNION queries
• OR epic multi-way JOIN
• Adding new data types HARD
Splunk

• Splunk is enterprise software used to
  monitor, report and analyze the data
  produced by the applications, systems and
  infrastructure to run a business.
                              -Wikidpedia
Splunk

• Splunk is enterprise software used to
  monitor, report and analyze the data
  produced by the applications, systems and
  infrastructure to run a business.
                             -Wikidpedia
$$$$$$$$$$$$$$
$$$$$$$$$$$$$$
$$$$$$$$$$$$$$
$$$$$$$$$$$$$$
$$$$$$$$$$$$$$
Splunk

• Small agent program on each host you tell
  about your log files - ships to server
• Server component analyzes / indexes your
  logs. Also a syslog server.
• Builds structure from your data - in a GUI.
Splunk

• Splunk is amazing.
• You just tip logs into it, structure later.
• If you can afford the license, use
  it, be happy!
I cannot afford splunk
I cannot afford splunk
I cannot afford splunk


• Sad panda!
• Also, splunk isn’t extensible - black box.
• So, a guy called Jorden Sissel invented:
Logstash
Diversion -
          ElasticSearch
• Just tip JSON documents into it (with a
  type)
• Figures out structure for each type, indexes
  appropriately.
• Free sharding and replication
So
• We post-process logs to be somewhat
  structured.
• We can then search over them (fast!)
 • Free text (for text fields)
 • Numeric
 • Dates + ranges
New types

• Trivial!
• Just emit it, it’s indexed and queryable.
• Can hint elasticsearch for better queries (if
  needed)
Logstash
  In JRuby, by Jordan Sissel

            Input
Simple:     Filter
           Output

           Flexible
         Extensible
   Plays well with others
   Pre-built web interface
Logstash
Logstash
 INPUT

 FILTER

OUTPUT
Logstash
Logstash
 INPUT

 FILTER

OUTPUT
Logstash
Logstash
   IS
MASSIVE
440Mb
 IDLE!
2+Gb
working
440Mb
 IDLE!
OH HAI
 JVM
Java (JRuby) decoding
  AMQP is, however
much much faster than
   perl doing that...

       JVM+-
Logstash on each host
   is totally out...

• Running it on ElasticSearch servers which
   are already dedicated to this is fine..
• I’d still like to reuse all of it’s parsing
Lots of my data is
      already JSON
• Log::Message::Structured
• AnyEvent::RabbitMQ
• App logging relies on Rabbit being up
• Can get slow if rabbit is sick and blocks
How about this then?
But not in the right
        format..
• So I can write a munger in ruby...
• Or I can write one in perl.
• I’m already (going to be) running a
  collection / aggregation daemon on each
  host (for apache logs).
It works!!!
Myxomatosis

• If RabbitMQ gets really sick, app slows
  down.
• Multiple exponential backoffs
• AMQP is crap for ‘fire and forget’
Syslog

• Yes, I could. But JSON in syslog - just no.
• 1024 bytes - UDP packet.
• Not inventing my own protocol!
ZeroMQ has the
    correct semantics
• Pub/Sub sockets
• Never, ever blocking
• Lossy! (If needed)
• Buffer sizes / locations configureable
• Arbitrary message size
Subset of logstash

• In perl
• ZeroMQ receiver
• Per host aggregation
• Push AMQP to RabbitMQ
• Run logstash on a central server
Subset of logstash

• Small async process. ZMQ receive socket.
• Pull JSON from ZMQ, decode, munge, emit
  back to AMQP
• Slowness no longer blocks app servers
Subset of logstash
• Use logstash at the other end to pop
  AMQP and insert into ElasticSearch
• Keep per-host cost small
• Same process can tail logfiles and cast into
  AMQP
• Reuse all the logstash parsing (at server
  side) for apache logs etc
100% drop in
compatible subset of
     logstash
100% drop in
 compatible subset of
      logstash
   In perl - making it easy for you to emit
       structured app events as JSON.

Everything is down - your app is still up (you
               lose some logs)
440Mb
 IDLE!
24Mb
24Mb
I used Moose - RAM use can and will go down.
Current architecture
Screenshot
Yes, yes - I know

• The web app is fugly
• Other people already have alternate
  implementations
• Keeping interoperable opens lots of choices
• E.g. graylog2 as the event sink
rfc3164
• This document describes the observed behavior
  of the syslog protocol
• This is not a good place to be.
• Working with Jordan to document message
  format.
• End to end tests of both implementations
  to follow.
Code

• http://logstash.net/
• https://github.com/bobtfish/Log-Stash
• https://github.com/logstash/logstash
Thanks!
• <bobtfish@bobtfish.net>
• t0m on irc.perl.org
• And Freenode (idle in #logstash)

• We are hiring!!!
 • Developers (learn ruby, or perl, or both!)
 • Front end people (play with websockets!)
This is all now pointless

• The latest logstash .jar will do all the
  mungeing for you.
• And it (mostly) runs in MRI (C ruby), so my
  RAM thing is less bad.
• N implementations still a good thing!

Mais conteúdo relacionado

Mais procurados

Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQAll Things Open
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQNahidul Kibria
 
ruby + websocket + haproxy
ruby + websocket + haproxyruby + websocket + haproxy
ruby + websocket + haproxyMathieu Elie
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim CrontabsPaolo Negri
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Paolo Negri
 
IPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onIPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onAPNIC
 
Scaling applications with RabbitMQ at SunshinePHP
Scaling applications with RabbitMQ   at SunshinePHPScaling applications with RabbitMQ   at SunshinePHP
Scaling applications with RabbitMQ at SunshinePHPAlvaro Videla
 
RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsHoucheng Lin
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message BrokerMartin Toshev
 
Ruby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxRuby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxMathieu Elie
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQJames Carr
 
Windows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance ComparisonWindows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance ComparisonSeungmo Koo
 
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQAlvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQTanya Denisyuk
 
Whoops! I Rewrote It in Rust
Whoops! I Rewrote It in RustWhoops! I Rewrote It in Rust
Whoops! I Rewrote It in RustScyllaDB
 
CPAN Gems From The Far East
CPAN Gems From The Far EastCPAN Gems From The Far East
CPAN Gems From The Far Eastlestrrat
 
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)James Titcumb
 
Rust Is Safe. But Is It Fast?
Rust Is Safe. But Is It Fast?Rust Is Safe. But Is It Fast?
Rust Is Safe. But Is It Fast?ScyllaDB
 
On Rabbits and Elephants
On Rabbits and ElephantsOn Rabbits and Elephants
On Rabbits and ElephantsGavin Roy
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepthWee Keat Chin
 

Mais procurados (20)

Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
 
ruby + websocket + haproxy
ruby + websocket + haproxyruby + websocket + haproxy
ruby + websocket + haproxy
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
 
IPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onIPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-on
 
Scaling applications with RabbitMQ at SunshinePHP
Scaling applications with RabbitMQ   at SunshinePHPScaling applications with RabbitMQ   at SunshinePHP
Scaling applications with RabbitMQ at SunshinePHP
 
RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example Applications
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
 
Ruby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxRuby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdx
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
 
Windows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance ComparisonWindows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance Comparison
 
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQAlvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
 
Whoops! I Rewrote It in Rust
Whoops! I Rewrote It in RustWhoops! I Rewrote It in Rust
Whoops! I Rewrote It in Rust
 
CPAN Gems From The Far East
CPAN Gems From The Far EastCPAN Gems From The Far East
CPAN Gems From The Far East
 
PostgreSQL: meet your queue
PostgreSQL: meet your queuePostgreSQL: meet your queue
PostgreSQL: meet your queue
 
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
 
Rust Is Safe. But Is It Fast?
Rust Is Safe. But Is It Fast?Rust Is Safe. But Is It Fast?
Rust Is Safe. But Is It Fast?
 
On Rabbits and Elephants
On Rabbits and ElephantsOn Rabbits and Elephants
On Rabbits and Elephants
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
 

Destaque

Perl Instruments
Perl InstrumentsPerl Instruments
Perl InstrumentsPedro Melo
 
Network Programming With Anyevent
Network Programming With AnyeventNetwork Programming With Anyevent
Network Programming With AnyeventPedro Melo
 
Scala and ZeroMQ: Events beyond the JVM
Scala and ZeroMQ: Events beyond the JVMScala and ZeroMQ: Events beyond the JVM
Scala and ZeroMQ: Events beyond the JVMRUDDER
 
Introduction to ZeroMQ
Introduction to ZeroMQIntroduction to ZeroMQ
Introduction to ZeroMQYiHung Lee
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqRuben Tan
 
Software Architecture over ZeroMQ
Software Architecture over ZeroMQSoftware Architecture over ZeroMQ
Software Architecture over ZeroMQpieterh
 
Build reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQBuild reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQRobin Xiao
 
Europycon2011: Implementing distributed application using ZeroMQ
Europycon2011: Implementing distributed application using ZeroMQEuropycon2011: Implementing distributed application using ZeroMQ
Europycon2011: Implementing distributed application using ZeroMQfcrippa
 
Universidad nacional autonoma de mexico ensayo 1
Universidad nacional autonoma de mexico ensayo 1Universidad nacional autonoma de mexico ensayo 1
Universidad nacional autonoma de mexico ensayo 1gabrielasuarezmorales18
 
Mural Vas For Telcos State Of The Industry Slideshare
Mural   Vas For Telcos   State Of The Industry   SlideshareMural   Vas For Telcos   State Of The Industry   Slideshare
Mural Vas For Telcos State Of The Industry SlideshareCloudProfile
 
Broadband_in_America
Broadband_in_AmericaBroadband_in_America
Broadband_in_AmericaChika Okose
 
Electromagnetic Field Radiation in the workpalce
Electromagnetic Field Radiation in the workpalceElectromagnetic Field Radiation in the workpalce
Electromagnetic Field Radiation in the workpalceNicolaas Wilhelmus Pieterse
 
Vas project RSC presentation final
Vas project RSC presentation finalVas project RSC presentation final
Vas project RSC presentation finalEva Law
 
Procontent.Ru: Andrew Bud (mBlox, MEF) presentation at VAS V Conference
Procontent.Ru: Andrew Bud (mBlox, MEF) presentation at VAS V ConferenceProcontent.Ru: Andrew Bud (mBlox, MEF) presentation at VAS V Conference
Procontent.Ru: Andrew Bud (mBlox, MEF) presentation at VAS V ConferenceProcontent.Ru Magazine
 
Online marketing campaigns
Online marketing campaignsOnline marketing campaigns
Online marketing campaignsIncredi Je
 
Perils of Perception Ipsos Mori - France
Perils of Perception Ipsos Mori - FrancePerils of Perception Ipsos Mori - France
Perils of Perception Ipsos Mori - FranceIpsos France
 
Slide 4 Xu Hướng Digital Marketing 2016 - buihongdiepcom
Slide 4 Xu Hướng Digital Marketing 2016 - buihongdiepcomSlide 4 Xu Hướng Digital Marketing 2016 - buihongdiepcom
Slide 4 Xu Hướng Digital Marketing 2016 - buihongdiepcomDiep Hong Bui
 

Destaque (20)

Plack
PlackPlack
Plack
 
Perl Instruments
Perl InstrumentsPerl Instruments
Perl Instruments
 
Network Programming With Anyevent
Network Programming With AnyeventNetwork Programming With Anyevent
Network Programming With Anyevent
 
Scala and ZeroMQ: Events beyond the JVM
Scala and ZeroMQ: Events beyond the JVMScala and ZeroMQ: Events beyond the JVM
Scala and ZeroMQ: Events beyond the JVM
 
Introduction to ZeroMQ
Introduction to ZeroMQIntroduction to ZeroMQ
Introduction to ZeroMQ
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
 
Software Architecture over ZeroMQ
Software Architecture over ZeroMQSoftware Architecture over ZeroMQ
Software Architecture over ZeroMQ
 
Build reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQBuild reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQ
 
Europycon2011: Implementing distributed application using ZeroMQ
Europycon2011: Implementing distributed application using ZeroMQEuropycon2011: Implementing distributed application using ZeroMQ
Europycon2011: Implementing distributed application using ZeroMQ
 
Universidad nacional autonoma de mexico ensayo 1
Universidad nacional autonoma de mexico ensayo 1Universidad nacional autonoma de mexico ensayo 1
Universidad nacional autonoma de mexico ensayo 1
 
Vm oer eden_2014_e1_volungeviciene
Vm oer eden_2014_e1_volungevicieneVm oer eden_2014_e1_volungeviciene
Vm oer eden_2014_e1_volungeviciene
 
3º básico b semana 03 al 07 de octubre
3º básico b semana  03 al 07 de octubre3º básico b semana  03 al 07 de octubre
3º básico b semana 03 al 07 de octubre
 
Mural Vas For Telcos State Of The Industry Slideshare
Mural   Vas For Telcos   State Of The Industry   SlideshareMural   Vas For Telcos   State Of The Industry   Slideshare
Mural Vas For Telcos State Of The Industry Slideshare
 
Broadband_in_America
Broadband_in_AmericaBroadband_in_America
Broadband_in_America
 
Electromagnetic Field Radiation in the workpalce
Electromagnetic Field Radiation in the workpalceElectromagnetic Field Radiation in the workpalce
Electromagnetic Field Radiation in the workpalce
 
Vas project RSC presentation final
Vas project RSC presentation finalVas project RSC presentation final
Vas project RSC presentation final
 
Procontent.Ru: Andrew Bud (mBlox, MEF) presentation at VAS V Conference
Procontent.Ru: Andrew Bud (mBlox, MEF) presentation at VAS V ConferenceProcontent.Ru: Andrew Bud (mBlox, MEF) presentation at VAS V Conference
Procontent.Ru: Andrew Bud (mBlox, MEF) presentation at VAS V Conference
 
Online marketing campaigns
Online marketing campaignsOnline marketing campaigns
Online marketing campaigns
 
Perils of Perception Ipsos Mori - France
Perils of Perception Ipsos Mori - FrancePerils of Perception Ipsos Mori - France
Perils of Perception Ipsos Mori - France
 
Slide 4 Xu Hướng Digital Marketing 2016 - buihongdiepcom
Slide 4 Xu Hướng Digital Marketing 2016 - buihongdiepcomSlide 4 Xu Hướng Digital Marketing 2016 - buihongdiepcom
Slide 4 Xu Hướng Digital Marketing 2016 - buihongdiepcom
 

Semelhante a Zero mq logs

Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012Tomas Doran
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_monTomas Doran
 
London devops logging
London devops loggingLondon devops logging
London devops loggingTomas Doran
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pieTomas Doran
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data SafeTony Tam
 
Java tuning on GNU/Linux for busy dev
Java tuning on GNU/Linux for busy devJava tuning on GNU/Linux for busy dev
Java tuning on GNU/Linux for busy devTomek Borek
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talkReuven Lerner
 
EUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangEUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangPaweł Pikuła
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGTomek Borek
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLArnab Biswas
 
PostgreSQL is the new NoSQL - at Devoxx 2018
PostgreSQL is the new NoSQL  - at Devoxx 2018PostgreSQL is the new NoSQL  - at Devoxx 2018
PostgreSQL is the new NoSQL - at Devoxx 2018Quentin Adam
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage SystemsSATOSHI TAGOMORI
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudAnshum Gupta
 
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.comRenzo Tomà
 
Storm presentation
Storm presentationStorm presentation
Storm presentationShyam Raj
 
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-BayesOSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-BayesNETWAYS
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous ApplicationsJohan Edstrom
 
Erlang: TL;DR
Erlang: TL;DRErlang: TL;DR
Erlang: TL;DRvorn
 

Semelhante a Zero mq logs (20)

Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
 
London devops logging
London devops loggingLondon devops logging
London devops logging
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pie
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
 
Java tuning on GNU/Linux for busy dev
Java tuning on GNU/Linux for busy devJava tuning on GNU/Linux for busy dev
Java tuning on GNU/Linux for busy dev
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
 
EUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangEUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old Erlang
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUG
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkML
 
PostgreSQL is the new NoSQL - at Devoxx 2018
PostgreSQL is the new NoSQL  - at Devoxx 2018PostgreSQL is the new NoSQL  - at Devoxx 2018
PostgreSQL is the new NoSQL - at Devoxx 2018
 
Logstash
LogstashLogstash
Logstash
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloud
 
Compression talk
Compression talkCompression talk
Compression talk
 
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.com
 
Storm presentation
Storm presentationStorm presentation
Storm presentation
 
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-BayesOSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Erlang: TL;DR
Erlang: TL;DRErlang: TL;DR
Erlang: TL;DR
 

Mais de Tomas Doran

Empowering developers to deploy their own data stores
Empowering developers to deploy their own data storesEmpowering developers to deploy their own data stores
Empowering developers to deploy their own data storesTomas Doran
 
Dockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internalsDockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internalsTomas Doran
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Tomas Doran
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflowTomas Doran
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerTomas Doran
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsChasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsTomas Doran
 
Deploying puppet code at light speed
Deploying puppet code at light speedDeploying puppet code at light speed
Deploying puppet code at light speedTomas Doran
 
Thinking through puppet code layout
Thinking through puppet code layoutThinking through puppet code layout
Thinking through puppet code layoutTomas Doran
 
Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013Tomas Doran
 
"The worst code I ever wrote"
"The worst code I ever wrote""The worst code I ever wrote"
"The worst code I ever wrote"Tomas Doran
 
Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Tomas Doran
 
Test driven infrastructure development
Test driven infrastructure developmentTest driven infrastructure development
Test driven infrastructure developmentTomas Doran
 
London devops - orc
London devops - orcLondon devops - orc
London devops - orcTomas Doran
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testingTomas Doran
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testingTomas Doran
 
Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!Tomas Doran
 
High scale flavour
High scale flavourHigh scale flavour
High scale flavourTomas Doran
 
Large platform architecture in (mostly) perl - an illustrated tour
Large platform architecture in (mostly) perl - an illustrated tourLarge platform architecture in (mostly) perl - an illustrated tour
Large platform architecture in (mostly) perl - an illustrated tourTomas Doran
 
Large platform architecture in (mostly) perl
Large platform architecture in (mostly) perlLarge platform architecture in (mostly) perl
Large platform architecture in (mostly) perlTomas Doran
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matterTomas Doran
 

Mais de Tomas Doran (20)

Empowering developers to deploy their own data stores
Empowering developers to deploy their own data storesEmpowering developers to deploy their own data stores
Empowering developers to deploy their own data stores
 
Dockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internalsDockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internals
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for Docker
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsChasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
 
Deploying puppet code at light speed
Deploying puppet code at light speedDeploying puppet code at light speed
Deploying puppet code at light speed
 
Thinking through puppet code layout
Thinking through puppet code layoutThinking through puppet code layout
Thinking through puppet code layout
 
Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013
 
"The worst code I ever wrote"
"The worst code I ever wrote""The worst code I ever wrote"
"The worst code I ever wrote"
 
Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)
 
Test driven infrastructure development
Test driven infrastructure developmentTest driven infrastructure development
Test driven infrastructure development
 
London devops - orc
London devops - orcLondon devops - orc
London devops - orc
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!
 
High scale flavour
High scale flavourHigh scale flavour
High scale flavour
 
Large platform architecture in (mostly) perl - an illustrated tour
Large platform architecture in (mostly) perl - an illustrated tourLarge platform architecture in (mostly) perl - an illustrated tour
Large platform architecture in (mostly) perl - an illustrated tour
 
Large platform architecture in (mostly) perl
Large platform architecture in (mostly) perlLarge platform architecture in (mostly) perl
Large platform architecture in (mostly) perl
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matter
 

Último

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 

Último (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 

Zero mq logs

  • 1. Using ZeroMQ and Elasticsearch for log aggregation Tomas Doran (t0m) <bobtfish@bobtfish.net>
  • 2. Who are you? • CPAN Developer • Catalyst core team • Moose hacker • AnyEvent::RabbitMQ user • Ruby/Python/C as needed • Dayjob - deveverthingops - state51 • 3/4 Pb of MogileFS - online music • Thousands of steams a second • Lots of perl. • Lots of servers • Lots of services
  • 3. Sorry! • This isn’t a ZeroMQ tutotial • This isn’t an ElasticSearch tutorial
  • 4. Debugging production • Is hard! • Especially interactions • Need to cross-correlate logs.
  • 5. Naïve solution • “Lets log into the database” • NO NO NO NO • 120 lines/s (7200 disk) • 167 lines/s (10k disk) • 250 lines/s (15k disk)
  • 6. Less naïve solution • Queue before we log • Bulk insert • No good for unstructured data • No good for many different structures
  • 7. Still a stupid solution • Lots of UNION queries • OR epic multi-way JOIN • Adding new data types HARD
  • 8. Splunk • Splunk is enterprise software used to monitor, report and analyze the data produced by the applications, systems and infrastructure to run a business. -Wikidpedia
  • 9. Splunk • Splunk is enterprise software used to monitor, report and analyze the data produced by the applications, systems and infrastructure to run a business. -Wikidpedia
  • 11. Splunk • Small agent program on each host you tell about your log files - ships to server • Server component analyzes / indexes your logs. Also a syslog server. • Builds structure from your data - in a GUI.
  • 12. Splunk • Splunk is amazing. • You just tip logs into it, structure later. • If you can afford the license, use it, be happy!
  • 13. I cannot afford splunk
  • 14. I cannot afford splunk
  • 15. I cannot afford splunk • Sad panda! • Also, splunk isn’t extensible - black box. • So, a guy called Jorden Sissel invented:
  • 17. Diversion - ElasticSearch • Just tip JSON documents into it (with a type) • Figures out structure for each type, indexes appropriately. • Free sharding and replication
  • 18. So • We post-process logs to be somewhat structured. • We can then search over them (fast!) • Free text (for text fields) • Numeric • Dates + ranges
  • 19. New types • Trivial! • Just emit it, it’s indexed and queryable. • Can hint elasticsearch for better queries (if needed)
  • 20. Logstash In JRuby, by Jordan Sissel Input Simple: Filter Output Flexible Extensible Plays well with others Pre-built web interface
  • 26. Logstash IS MASSIVE
  • 31. Java (JRuby) decoding AMQP is, however much much faster than perl doing that... JVM+-
  • 32. Logstash on each host is totally out... • Running it on ElasticSearch servers which are already dedicated to this is fine.. • I’d still like to reuse all of it’s parsing
  • 33. Lots of my data is already JSON • Log::Message::Structured • AnyEvent::RabbitMQ • App logging relies on Rabbit being up • Can get slow if rabbit is sick and blocks
  • 34. How about this then?
  • 35. But not in the right format.. • So I can write a munger in ruby... • Or I can write one in perl. • I’m already (going to be) running a collection / aggregation daemon on each host (for apache logs).
  • 37. Myxomatosis • If RabbitMQ gets really sick, app slows down. • Multiple exponential backoffs • AMQP is crap for ‘fire and forget’
  • 38. Syslog • Yes, I could. But JSON in syslog - just no. • 1024 bytes - UDP packet. • Not inventing my own protocol!
  • 39. ZeroMQ has the correct semantics • Pub/Sub sockets • Never, ever blocking • Lossy! (If needed) • Buffer sizes / locations configureable • Arbitrary message size
  • 40. Subset of logstash • In perl • ZeroMQ receiver • Per host aggregation • Push AMQP to RabbitMQ • Run logstash on a central server
  • 41. Subset of logstash • Small async process. ZMQ receive socket. • Pull JSON from ZMQ, decode, munge, emit back to AMQP • Slowness no longer blocks app servers
  • 42. Subset of logstash • Use logstash at the other end to pop AMQP and insert into ElasticSearch • Keep per-host cost small • Same process can tail logfiles and cast into AMQP • Reuse all the logstash parsing (at server side) for apache logs etc
  • 43. 100% drop in compatible subset of logstash
  • 44. 100% drop in compatible subset of logstash In perl - making it easy for you to emit structured app events as JSON. Everything is down - your app is still up (you lose some logs)
  • 46. 24Mb
  • 47. 24Mb I used Moose - RAM use can and will go down.
  • 50. Yes, yes - I know • The web app is fugly • Other people already have alternate implementations • Keeping interoperable opens lots of choices • E.g. graylog2 as the event sink
  • 51. rfc3164 • This document describes the observed behavior of the syslog protocol • This is not a good place to be. • Working with Jordan to document message format. • End to end tests of both implementations to follow.
  • 53. Thanks! • <bobtfish@bobtfish.net> • t0m on irc.perl.org • And Freenode (idle in #logstash) • We are hiring!!! • Developers (learn ruby, or perl, or both!) • Front end people (play with websockets!)
  • 54. This is all now pointless • The latest logstash .jar will do all the mungeing for you. • And it (mostly) runs in MRI (C ruby), so my RAM thing is less bad. • N implementations still a good thing!

Notas do Editor

  1. Mention state51, mention we&amp;#x2019;re hiring\n
  2. Mention JFDI, and I really don&amp;#x2019;t care what language it&amp;#x2019;s in\n
  3. The former has amazing documentation.\nThe latter, well, bad luck. (Great reference material, but docs not so great. Good mailing list though)\n
  4. grep is great, I love grep\nNot very good for 100 servers at once\nSolution needs to be just as good as grep for the simple case\n
  5. This is always the first thing sugested / thought of.\nIt&amp;#x2019;s great for audit trail, as your DB (should be!) durable\nDoing the simple thing is (at least) one disk rotation (aka fsync) per log line\n\n
  6. This solves the performance problems, but gives you a load more moving parts\nA table with id, date, message is likely to perform less well than grep\nOne table with lots of NULL cols, lots of tables (one per data type)\n
  7. And how do we get data back from this pile?\nNot as easy as grep!\nYou&amp;#x2019;re stuffed as soon as you add more data types\n
  8. We played with this. We liked it, a lot.\n
  9. Enterprise means\n
  10. Spenny\n
  11. So, what does it do?\nYou can just tip logs into it, and it&amp;#x2019;ll do the right thing... Even after the fact.\nSearching is fast fast fast!\n
  12. Really, it&amp;#x2019;s a great product.\nShame about the pricing.\n
  13. I&amp;#x2019;m also a little wary of using splunk as more than &amp;#x2018;turbo grep&amp;#x2019;\nSo, open source - someone else must have thought about this, right?\n
  14. I&amp;#x2019;m also a little wary of using splunk as more than &amp;#x2018;turbo grep&amp;#x2019;\nSo, open source - someone else must have thought about this, right?\n
  15. I&amp;#x2019;m also a little wary of using splunk as more than &amp;#x2018;turbo grep&amp;#x2019;\nSo, open source - someone else must have thought about this, right?\n
  16. Isn&amp;#x2019;t he cute? And woody!\n
  17. Sorry - just to go off at a tangent...\nLets make all our log messages JSON messages, as json is fast, easy to parse (and you can search it with grep!)\nLets throw it in elasticsearch. Ponies and unicorns for everyone.\n
  18. N.B. ElasticSeach storage will be MUCH larger than the bytes size (as it&amp;#x2019;s indexed 90 ways)\nWe post-process our logs before insertion, to pull out structured fields (e.g. dates &amp; durations)\n\n
  19. We can add new log message types (or start parsing things we currently add as simple text), make schema changes any time we want.\nWe just pour data into ElasticSearch, and then get better searching than grep!\nThe more it&amp;#x2019;s split into fields, the more we win, but just writing log lines still gives us as good as grep.\nAnyway - back to the story..\n
  20. Very simple model - input (pluggable), filtering (pluggable by type) in C, output (pluggable)\nLots of backends - AMQP and ElasticSearch + syslog and many others\nPre-built parser library for various line based log formats\nComes with web app for searches.. Everything I need!\n
  21. Lets take a simple case here - I&amp;#x2019;ll shove my apache logs from N servers into ElasticSearch\nI run a logstash on each host (writer), and one on each ElasticSearch server (reader)..\n
  22. So, that has 2 logstashes - one reading files and writing AMQP\nOne reading AMQP and writing to ElasticSearch\nHowever, my raw apache log lines need parsing (in the filter stage) - to be able to do things like &amp;#x2018;all apache requests with 500 status&amp;#x2019;, rather than &amp;#x2018;all apache requests containing the string 500&amp;#x2019;\n
  23. Red indicates the filtering\n
  24. There we go, everyone got that?\n
  25. Except I could instead do the filtering here, if I wanted to.\nDoesn&amp;#x2019;t really matter - depends what&amp;#x2019;s best for me..\nRight, so... Lets try that then?\n
  26. First problem...\n
  27. Well then, I&amp;#x2019;m not going to be running this on the end nodes.\n
  28. And it&amp;#x2019;s not tiny, even on machines dedicated to log parsing / filtering / indexing\n
  29. But sure, I spun it up on a couple of spare machines...\n
  30. It works fairly well as advertised.\n
  31. The JVM giveth (lots of awesome software), the JVM taketh away (any RAM you had).\nruby is generally slower than perl. jruby is generally faster than perl.\nI&amp;#x2019;m not actually knocking the technology here - just saying it won&amp;#x2019;t work in this situation for me.\n
  32. So, anyway, I&amp;#x2019;m totally stuffed... The previous plan is a non-starter.\nSo I need something to collect logs from each host and ship them to AMQP\nOk, cool, I can write that in plain ruby or plain perl and it&amp;#x2019;s gotta be slimmer, right?\n
  33. But wait a second... I just want to get something &amp;#x2018;real&amp;#x2019; running here...\nSo, I&amp;#x2019;m already tipping stuff into AMQP..\n\n\n
  34. So I can just use my existing structured data, right.. Well - no, sorry..\nAnd I got distracted at this point. For about 6 months.\n
  35. So I come back to this, still needing something to munge my JSON into other JSON.\nBut, right now, the easiest thing to try is:\n
  36. 30 line perl script, it works.\nI have data in ElasticSearch.\nI can view it in the logstash webapp\n
  37. Going back a few slides - if RabbitMQ gets sick, everything goes bad.\nI ended up with a load of code to deal with this.\nIt still didn&amp;#x2019;t work very well.\nIn fact, the entire idea of using TCP/IP for this is probably bad.\n\n
  38. Syslog is hateful.\nMOST of my log messages are under 1024 bytes, but I don&amp;#x2019;t want to throw them away (or throw an exception) if they aren&amp;#x2019;t.\n
  39. ZeroMQ looked like the right answer.\nI played with it. It works REALLY well.\nI&amp;#x2019;d recommend you try it.\n
  40. So lets write this per host collection daemon\nTake our previous mungeing code, and run it per host in the aggregation process\n
  41. Tada! I have fixed all my woes with rabbitmq and at the same time I&amp;#x2019;ve got my app logs in logstash format for free.\n\n
  42. I can reuse all the heavy-lifting parts of logstash.\nI can reuse my per host ZMQ daemon as a log file tailer.\nOverhead on hosts is very small. Heavy lifting occurs entirely in the search cluster.\n
  43. So, to recap... I&amp;#x2019;ve got....\n
  44. I&amp;#x2019;ve got a solution to logging lots of stuff but not blocking or falling over.\n
  45. I&amp;#x2019;ve got a solution that has a minimal impact on my servers.\n\n
  46. \n
  47. \n
  48. So, this is what it actually looks like.\nRaw app logs go to the agent via ZMQ. It munges them to processed logstash logs, emits.\nAgent also tails fails and emits raw logstash\nLogstash does parsing of apache logs\n
  49. \n
  50. It&amp;#x2019;s taken me over 6 months to get any of it running, I don&amp;#x2019;t have time to re-write the web app\nSomeone else is already doing that.\nI love open source.\n
  51. So, I&amp;#x2019;ve talked about these &amp;#x2018;raw&amp;#x2019; and &amp;#x2018;processed&amp;#x2019; log formats - they&amp;#x2019;re just conventions to what fields can be found in the JSON.\nThis still needs to be better documented!\n
  52. \n
  53. \n
  54. \n