SlideShare una empresa de Scribd logo
1 de 25
Fluentd For
Small Projects        Structured logging

                      Pluggable architecture

                      Reliable
                      forwarding


Kazuki Ohta
Treasure Data, Inc.
@kzk_mover
Self-Introduction
•   Kazuki Ohta
    >   twitter: @kzk_mover
    >   github: kzk

•   Treasure Data, Inc.
    >   Chief Technology Officer; Founder
    >   Original Fluentd Author @frsyuki is another co-founder.

•   Open-Source Enthusiast
    >   KDE, uim, Hadoop, memcached, Mozilla, Mongo, etc.
    >   td-agent package manager
Fluentd∼
What’s Fluentd?
                                   time
    Application                     tag
                  2012-02-04 01:33:51
                  myapp.buylog {
     Fluentd        “user”: ”me”,
                    “path”: “/buyItem”,
                    “price”: 150,
                    “referer”: “/landing”
                  }
      Storage                   record
What’s Fluentd?

             Application



                           filter / buffer /
              Fluentd
                           routing




    SaaS       Storage           Fluentd

   Plug-in    Plug-in           Plug-in
What’s Fluentd?

syslogd    Scribe    Application          File Plug-in

                                   tail
Plug-in    Plug-in
                      Fluentd        filter / buffer / routing




          SaaS         Storage               Fluentd

      Plug-in         Plug-in                Plug-in
Fluentd is Casual...?

   @tagomoris           @hotchpotch




                   15,000,000 UU @ Cookpad
∼80,000 msgs/sec
Yes.
 Fluentd is


CASUAL
Fluentd Solves Daily Problems
•   Operation Problems
    >   ssh root@bad-node && tail -f log.txt
    >   cap deploy && pray
    >   How many PV/UUs we have now?
    >   How many users which did XXX and YYY?

•   Support
    >   User A claimed that he bought 10 items, could
        you confirm that?
But Your Boss
      Might Say....
•   「Log... For What?」

•   「What’s Fluentd?」

•   「OK, Who uses It?」

•   「We have syslogd」
Start Fluentd, Silently...
•   Log Everything As JSON!
    >   TSV/CSV logs are the nightmare.


•   Install td-agent
    >   rpm/deb/chef/puppet etc.


•   tail plugin + MongoDB
    >   tailing existing files.
    >   no need to change existing systems.
Figure 1: Common Log Operations




                             Analytics

                             Error Notify

                             Recommendation
Figure 2: Types of Logs




                          App Log

                          Access Log
                          (Apache, Rails, etc.)
                          System Log
                          (syslog etc.)
                          Others
5 ways to convince

    your boss

  to use Fluentd
1) Support System
• All logs are stored in MongoDB
• No need to write ad-hoc log analysis scripts.
            before                        after
#!/usr/bin/ruby                  $ mongo i-hate-mongo
open( log.txt ).each_line {¦l¦   > db.logs.find({ user : 12345})
   ls = l.strip.split
   user = ls[4]
   puts l if user == 12345
}
      $ ruby a.rb > foo.txt
2) Realtime System Stats



          SCREENSHOT
2) Realtime System Stats
•   Librato Metrics
    >   Realtime Stats
    >   Realtime Alert
    >   Graphite+Nagios
        as a Service
    >   GrowthForecast+Nagios
          http://d.hatena.ne.jp/tagomoris/20120330/1333077746

•   Important Metrics....
    >   queue depth, # of concurrent users, # of sql queries, #
        of slow queries, etc.
3) Error Log Collection
# waf.rb            App
                             Fluentd  MongoDB
begin              WAF

   app.run
                        ERROR!
rescue => e
   Fluent::Logger.post("error", {"e"=>e.to_s})
end
$ mongo db
> db.error.find() # Recent 10 errors
4) Error Notifications
 •   “Semi-Realtime” Error Notifications

 •   IRC, HipChat, Campfire, PagerDuty,
     AirBrake, Skype, etc.
                              TD s Internal Chat


 <match app.error>
  type campfire
  room DevOpsRoom
 </match>
5) Log Analysis                          MongoDB


•   MongoDB                     App       Fluentd

    $ mongo db                                TD
    > db.logs.distinct( uid ).count()

•   Treasure Data

    $ td query 
       SELECT count(distinct uid) FROM logs
Conclusion.
Fluentd is for...
 •   Support System

 •   Realtime System Stats

 •   Realtime Alert

 •   Error Notifications

 •   Log Analysis

 •   ...
#3
Github Issues


     #3
Fluentd
conveys
message
伝書鳩

Más contenido relacionado

Más de Treasure Data, Inc.

Más de Treasure Data, Inc. (20)

GDPR: A Practical Guide for Marketers
GDPR: A Practical Guide for MarketersGDPR: A Practical Guide for Marketers
GDPR: A Practical Guide for Marketers
 
AR and VR by the Numbers: A Data First Approach to the Technology and Market
AR and VR by the Numbers: A Data First Approach to the Technology and MarketAR and VR by the Numbers: A Data First Approach to the Technology and Market
AR and VR by the Numbers: A Data First Approach to the Technology and Market
 
Introduction to Customer Data Platforms
Introduction to Customer Data PlatformsIntroduction to Customer Data Platforms
Introduction to Customer Data Platforms
 
Hands On: Javascript SDK
Hands On: Javascript SDKHands On: Javascript SDK
Hands On: Javascript SDK
 
Hands-On: Managing Slowly Changing Dimensions Using TD Workflow
Hands-On: Managing Slowly Changing Dimensions Using TD WorkflowHands-On: Managing Slowly Changing Dimensions Using TD Workflow
Hands-On: Managing Slowly Changing Dimensions Using TD Workflow
 
Brand Analytics Management: Measuring CLV Across Platforms, Devices and Apps
Brand Analytics Management: Measuring CLV Across Platforms, Devices and AppsBrand Analytics Management: Measuring CLV Across Platforms, Devices and Apps
Brand Analytics Management: Measuring CLV Across Platforms, Devices and Apps
 
How to Power Your Customer Experience with Data
How to Power Your Customer Experience with DataHow to Power Your Customer Experience with Data
How to Power Your Customer Experience with Data
 
Why Your VR Game is Virtually Useless Without Data
Why Your VR Game is Virtually Useless Without DataWhy Your VR Game is Virtually Useless Without Data
Why Your VR Game is Virtually Useless Without Data
 
Connecting the Customer Data Dots
Connecting the Customer Data DotsConnecting the Customer Data Dots
Connecting the Customer Data Dots
 
Harnessing Data for Better Customer Experience and Company Success
Harnessing Data for Better Customer Experience and Company SuccessHarnessing Data for Better Customer Experience and Company Success
Harnessing Data for Better Customer Experience and Company Success
 
글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)
글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)
글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)
 
Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14
 
Introduction to New features and Use cases of Hivemall
Introduction to New features and Use cases of HivemallIntroduction to New features and Use cases of Hivemall
Introduction to New features and Use cases of Hivemall
 
Scalable Hadoop in the cloud
Scalable Hadoop in the cloudScalable Hadoop in the cloud
Scalable Hadoop in the cloud
 
Using Embulk at Treasure Data
Using Embulk at Treasure DataUsing Embulk at Treasure Data
Using Embulk at Treasure Data
 
Scaling to Infinity - Open Source meets Big Data
Scaling to Infinity - Open Source meets Big DataScaling to Infinity - Open Source meets Big Data
Scaling to Infinity - Open Source meets Big Data
 
Treasure Data: Move your data from MySQL to Redshift with (not much more tha...
Treasure Data:  Move your data from MySQL to Redshift with (not much more tha...Treasure Data:  Move your data from MySQL to Redshift with (not much more tha...
Treasure Data: Move your data from MySQL to Redshift with (not much more tha...
 
Treasure Data From MySQL to Redshift
Treasure Data  From MySQL to RedshiftTreasure Data  From MySQL to Redshift
Treasure Data From MySQL to Redshift
 
Unifying Events and Logs into the Cloud
Unifying Events and Logs into the CloudUnifying Events and Logs into the Cloud
Unifying Events and Logs into the Cloud
 
Fluentd and Docker - running fluentd within a docker container
Fluentd and Docker - running fluentd within a docker containerFluentd and Docker - running fluentd within a docker container
Fluentd and Docker - running fluentd within a docker container
 

Último

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

Fluentd for Small Projects @ Fluentd Casual 20120518

  • 1. Fluentd For Small Projects Structured logging Pluggable architecture Reliable forwarding Kazuki Ohta Treasure Data, Inc. @kzk_mover
  • 2. Self-Introduction • Kazuki Ohta > twitter: @kzk_mover > github: kzk • Treasure Data, Inc. > Chief Technology Officer; Founder > Original Fluentd Author @frsyuki is another co-founder. • Open-Source Enthusiast > KDE, uim, Hadoop, memcached, Mozilla, Mongo, etc. > td-agent package manager
  • 4. What’s Fluentd? time Application tag 2012-02-04 01:33:51 myapp.buylog { Fluentd “user”: ”me”, “path”: “/buyItem”, “price”: 150, “referer”: “/landing” } Storage record
  • 5. What’s Fluentd? Application filter / buffer / Fluentd routing SaaS Storage Fluentd Plug-in Plug-in Plug-in
  • 6. What’s Fluentd? syslogd Scribe Application File Plug-in tail Plug-in Plug-in Fluentd filter / buffer / routing SaaS Storage Fluentd Plug-in Plug-in Plug-in
  • 7. Fluentd is Casual...? @tagomoris @hotchpotch 15,000,000 UU @ Cookpad ∼80,000 msgs/sec
  • 9. Fluentd Solves Daily Problems • Operation Problems > ssh root@bad-node && tail -f log.txt > cap deploy && pray > How many PV/UUs we have now? > How many users which did XXX and YYY? • Support > User A claimed that he bought 10 items, could you confirm that?
  • 10. But Your Boss Might Say.... • 「Log... For What?」 • 「What’s Fluentd?」 • 「OK, Who uses It?」 • 「We have syslogd」
  • 11. Start Fluentd, Silently... • Log Everything As JSON! > TSV/CSV logs are the nightmare. • Install td-agent > rpm/deb/chef/puppet etc. • tail plugin + MongoDB > tailing existing files. > no need to change existing systems.
  • 12. Figure 1: Common Log Operations Analytics Error Notify Recommendation
  • 13. Figure 2: Types of Logs App Log Access Log (Apache, Rails, etc.) System Log (syslog etc.) Others
  • 14. 5 ways to convince your boss to use Fluentd
  • 15. 1) Support System • All logs are stored in MongoDB • No need to write ad-hoc log analysis scripts. before after #!/usr/bin/ruby $ mongo i-hate-mongo open( log.txt ).each_line {¦l¦ > db.logs.find({ user : 12345}) ls = l.strip.split user = ls[4] puts l if user == 12345 } $ ruby a.rb > foo.txt
  • 16. 2) Realtime System Stats SCREENSHOT
  • 17. 2) Realtime System Stats • Librato Metrics > Realtime Stats > Realtime Alert > Graphite+Nagios as a Service > GrowthForecast+Nagios http://d.hatena.ne.jp/tagomoris/20120330/1333077746 • Important Metrics.... > queue depth, # of concurrent users, # of sql queries, # of slow queries, etc.
  • 18. 3) Error Log Collection # waf.rb App Fluentd MongoDB begin WAF app.run ERROR! rescue => e Fluent::Logger.post("error", {"e"=>e.to_s}) end $ mongo db > db.error.find() # Recent 10 errors
  • 19. 4) Error Notifications • “Semi-Realtime” Error Notifications • IRC, HipChat, Campfire, PagerDuty, AirBrake, Skype, etc. TD s Internal Chat <match app.error> type campfire room DevOpsRoom </match>
  • 20. 5) Log Analysis MongoDB • MongoDB App Fluentd $ mongo db TD > db.logs.distinct( uid ).count() • Treasure Data $ td query SELECT count(distinct uid) FROM logs
  • 21. Conclusion. Fluentd is for... • Support System • Realtime System Stats • Realtime Alert • Error Notifications • Log Analysis • ...
  • 22. #3

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n