SlideShare a Scribd company logo
1 of 44
Download to read offline
FLUENTD 101
BOOTSTRAP OF UNIFIED LOGGING
Open Source Summit Japan 2017
Fluentd Mini Summit / June 1, 2017
Satoshi Tagomori (@tagomoris)
Treasure Data, Inc.
Satoshi "Moris" Tagomori
(@tagomoris)
Fluentd, MessagePack-Ruby, Norikra, ...
Treasure Data, Inc.
What is Fluentd?
"Fluentd is an open source data collector
for unified logging layer."
https://www.fluentd.org/
"Unified Logging Layer" ?
"Fluentd decouples data sources from backend systems by
providing a unified logging layer in between."
SQL
"Unified Logging Layer" ?
"Fluentd decouples data sources from backend systems by
providing a unified logging layer in between."
SQL
Unified
Logging
Layer
"Unified Logging Layer" ?
"Fluentd decouples data sources from backend systems by
providing a unified logging layer in between."
SQL
"Unified Logging Layer" ?
"Fluentd decouples data sources from backend systems by
providing a unified logging layer in between."
SQL
AN EXTENSIBLE & RELIABLE DATA COLLECTION TOOL
Simple Core w/ Plugin System
+
Various Plugins
Buffering, Retries, Failover
# logs from a file
<source>
@type tail
path /var/log/httpd.log
pos_file /tmp/pos_file
tag web.access
<parse>
@type apache2
</parse>
</source>
# logs from client libraries
<source>
@type forward
port 24224
</source>
# store logs to ES and HDFS
<match web.*>
@type copy
<store>
@type elasticsearch
logstash_format true
</store>
<store>
@type webhdfs
host namenode.local
port 50070
path /path/on/hdfs
<format>
@type json
</format>
</store>
</match>
Configuration (v0.14)
Implementation / Performance
• Fluentd is written in Ruby
• C extension libraries for performance requirement
• cool.io: Asynchronous I/O
• msgpack: Serialization/Deserialization for MessagePack
• Plugins in Ruby - easy to join the community
• Scaling for CPU cores
• multiprocess plugin (~ v0.12)
• multi process workers (v0.14 ~)
Package / Deployment
• Fluentd released on RubyGems.org
• rpm/deb package
• td-agent by Treasure Data
• Fluentd + some widely-used plugins
• td-agent2: Fluentd v0.12
• td-agent3 (beta now): Fluentd v0.14 (or v1)
• + msi package for Windows
• Docker images
• https://hub.docker.com/r/fluent/fluentd/
For Users in the Enterprise Sector
More security features and some others
https://fluentd.treasuredata.com/
Plugin System
3rd party input plugins
dstat
df AMQL
munin
jvmwatcher
SQL
3rd party output plugins
Graphite
Buffer OutputParserInput FormatterFilter
“output-ish”“input-ish”
“output-ish”“input-ish”
Storage
Helper
Buffer OutputParserInput FormatterFilter
Fluentd v0.14
Fluentd v0.12
Plugins
• Built-in plugins
• tail, forward, file, exec, exec_filter, copy, ...
• 3rd party plugins (755 plugins at May 19)
• fluent-plugin-xxx via rubygems.org
• webhdfs, kafka, elasticsearch, redshift, bigquery, ...
• Plugin script
• .rb script files on /etc/fluent/plugin
Ecosystem
Events
Events: Structured Logs
ec_service.shopping_cart
2017-03-30 16:35:37 +0100
{
"container_id": "bfdd5b9....",
"container_name": "/infallible_mayer",
"source": "stdout",
"event": "put an item to cart",
"item_id": 101,
"items": 10,
"client": "web"
}
tag
timestamp
record
Event: tag, timestamp and record
• Tag
• A dot-separated string
• to show what the event is / where the event from
• Timestamp
• An integer of unix time (~ v0.12)
• A structured timestamp with nano seconds (v0.14 ~)
• Record
• Key-value pairs
Data Source
router
input plugin
read / receive
raw data
eventeventeventevent
parser plugin
parse data into key-values
parse timestamp from record
add tags
output plugin
with buffering
eventeventeventevent
format plugin
buffer plugin
formatted data
Data Destination
write / send
Buffers and Retries
Buffer & Retry for Micro-Try&Error
Retry
Retry
Batch
Stream Error
Retry
Retry
Controlled Recovery from Long Outage
Buffer
(on-disk or in-memory)
Error
Overloaded!!
recovery
recovery + flow control
queued chunks
Last Resort: Secondary Output
Error
queued chunks
# store logs to ES, or file if it goes down
<match web.*>
@type elasticsearch
logstash_format true
<secondary>
@type secondary_file
path /data/backup/web
</secondary>
</match>
Configuration: Secondary Output (v0.14)
Forwarding Data via Network
Forward Plugin: Forwarding Data via Network
• Built-in plugin, TCP port 24224 (in default)
• with heartbeat protocol (default UDP in v0.12, TCP/TLS in v0.14)
• Transfer data via TCP
• From Fluentd to Fluentd
• From logger libraries to Fluentd
• From Fluent-bit to Fluentd
• From Docker logging driver to Fluentd
• Standard protocol

https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1

(Spec v0 at Fluentd v0.12 or earlier -> Spec v1 at Fluentd 0.14)
Forward: Features
• Load Balancing / High Availability
• Servers with weights
• Standby servers
• DNS round robin
• Controlling Data Transferring Semantics
• at-most-once / at-least-once transferring
• Spec v1 Features
• TLS support
• Simple authentication/authorization
• Efficient data transferring: Gzip Compression (v0.14)
Forward Plugin: Load Balancing
60
60
60
60
60
60
60
20
weight: 60 (default)
weight: 60 (default)
weight: 60 (default)
weight: 20
Balance Data with Configured Weight
Forward Plugin: Handling Server Failure
Detecting Server Down/Up using Heartbeat
Error
Forward Plugin: Standby Server
Detecting Server Down/Up using Heartbeat
standby: true
Error
standby: true
Forward Plugin: Without ACK (at-most-once)
forward output
buffer
forward input any output
forward output forward input any output
bufferbuffer
Without any troubles
With troubles about buffers in destination
forward output
buffer
forward input any output
forward output forward input any output
buffer buffer
Events will be lost in this case :(
Forward Plugin: With ACK (at-least-once)
forward output
buffer
forward input any output
forward output forward input any output
buffer
Forward output:
require_ack_response: true
forward output forward input any output
buffer
buffer
buffer ACK
with chunk id
forward output forward input any output
buffer
buffer
with chunk id
Forward Plugin: With ACK (at-least-once)
forward output
buffer
forward input any output
forward output forward input any output
Forward output:
require_ack_response: true
forward output forward input any output
buffer
buffer ACK missing
forward output forward input any output
with chunk id
buffer
buffer
with chunk id
retry
Forward output ensure to transfer
buffers to any living destinations :D
Fluentd has many good stuffs

for logging.
Discover more on docs.fluentd.org!
Happy Logging!
@tagomoris

More Related Content

What's hot

AWS 빅데이터 아키텍처 패턴 및 모범 사례- AWS Summit Seoul 2017
AWS 빅데이터 아키텍처 패턴 및 모범 사례- AWS Summit Seoul 2017AWS 빅데이터 아키텍처 패턴 및 모범 사례- AWS Summit Seoul 2017
AWS 빅데이터 아키텍처 패턴 및 모범 사례- AWS Summit Seoul 2017
Amazon Web Services Korea
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
SANG WON PARK
 

What's hot (20)

Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
 
elasticsearch_적용 및 활용_정리
elasticsearch_적용 및 활용_정리elasticsearch_적용 및 활용_정리
elasticsearch_적용 및 활용_정리
 
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
 
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
 
효과적인 NoSQL (Elasticahe / DynamoDB) 디자인 및 활용 방안 (최유정 & 최홍식, AWS 솔루션즈 아키텍트) :: ...
효과적인 NoSQL (Elasticahe / DynamoDB) 디자인 및 활용 방안 (최유정 & 최홍식, AWS 솔루션즈 아키텍트) :: ...효과적인 NoSQL (Elasticahe / DynamoDB) 디자인 및 활용 방안 (최유정 & 최홍식, AWS 솔루션즈 아키텍트) :: ...
효과적인 NoSQL (Elasticahe / DynamoDB) 디자인 및 활용 방안 (최유정 & 최홍식, AWS 솔루션즈 아키텍트) :: ...
 
Amazon Redshift의 이해와 활용 (김용우) - AWS DB Day
Amazon Redshift의 이해와 활용 (김용우) - AWS DB DayAmazon Redshift의 이해와 활용 (김용우) - AWS DB Day
Amazon Redshift의 이해와 활용 (김용우) - AWS DB Day
 
Serverless with IAC - terraform과 cloudformation 비교
Serverless with IAC - terraform과 cloudformation 비교Serverless with IAC - terraform과 cloudformation 비교
Serverless with IAC - terraform과 cloudformation 비교
 
AWS Fargate on EKS 실전 사용하기
AWS Fargate on EKS 실전 사용하기AWS Fargate on EKS 실전 사용하기
AWS Fargate on EKS 실전 사용하기
 
The basics of fluentd
The basics of fluentdThe basics of fluentd
The basics of fluentd
 
Kubernetes design principles, patterns and ecosystem
Kubernetes design principles, patterns and ecosystemKubernetes design principles, patterns and ecosystem
Kubernetes design principles, patterns and ecosystem
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
AWS 빅데이터 아키텍처 패턴 및 모범 사례- AWS Summit Seoul 2017
AWS 빅데이터 아키텍처 패턴 및 모범 사례- AWS Summit Seoul 2017AWS 빅데이터 아키텍처 패턴 및 모범 사례- AWS Summit Seoul 2017
AWS 빅데이터 아키텍처 패턴 및 모범 사례- AWS Summit Seoul 2017
 
롯데이커머스의 마이크로 서비스 아키텍처 진화와 비용 관점의 운영 노하우-나현길, 롯데이커머스 클라우드플랫폼 팀장::AWS 마이그레이션 A ...
롯데이커머스의 마이크로 서비스 아키텍처 진화와 비용 관점의 운영 노하우-나현길, 롯데이커머스 클라우드플랫폼 팀장::AWS 마이그레이션 A ...롯데이커머스의 마이크로 서비스 아키텍처 진화와 비용 관점의 운영 노하우-나현길, 롯데이커머스 클라우드플랫폼 팀장::AWS 마이그레이션 A ...
롯데이커머스의 마이크로 서비스 아키텍처 진화와 비용 관점의 운영 노하우-나현길, 롯데이커머스 클라우드플랫폼 팀장::AWS 마이그레이션 A ...
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
AWS OpsWorksハンズオン
AWS OpsWorksハンズオンAWS OpsWorksハンズオン
AWS OpsWorksハンズオン
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
 
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
 
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
 
실시간 스트리밍 분석 Kinesis Data Analytics Deep Dive
실시간 스트리밍 분석  Kinesis Data Analytics Deep Dive실시간 스트리밍 분석  Kinesis Data Analytics Deep Dive
실시간 스트리밍 분석 Kinesis Data Analytics Deep Dive
 
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
 

Viewers also liked

Viewers also liked (6)

Fluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellFluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshell
 
Beyond 12 Factor - Developing Cloud Native Applications
Beyond 12 Factor - Developing Cloud Native ApplicationsBeyond 12 Factor - Developing Cloud Native Applications
Beyond 12 Factor - Developing Cloud Native Applications
 
12 factor app an introduction
12 factor app an introduction12 factor app an introduction
12 factor app an introduction
 
Cloud Native Logging / Fluentd Summit Tokyo
Cloud Native Logging / Fluentd Summit TokyoCloud Native Logging / Fluentd Summit Tokyo
Cloud Native Logging / Fluentd Summit Tokyo
 
The 12 Factor App
The 12 Factor AppThe 12 Factor App
The 12 Factor App
 
Fluentd Hacking Guide at RubyKaigi 2014
Fluentd Hacking Guide at RubyKaigi 2014Fluentd Hacking Guide at RubyKaigi 2014
Fluentd Hacking Guide at RubyKaigi 2014
 

Similar to Fluentd 101

Docker intro
Docker introDocker intro
Docker intro
spiddy
 

Similar to Fluentd 101 (20)

Fluentd at HKOScon
Fluentd at HKOSconFluentd at HKOScon
Fluentd at HKOScon
 
Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and Then
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container Era
 
DBCC 2021 - FLiP Stack for Cloud Data Lakes
DBCC 2021 - FLiP Stack for Cloud Data LakesDBCC 2021 - FLiP Stack for Cloud Data Lakes
DBCC 2021 - FLiP Stack for Cloud Data Lakes
 
Experiences with Microservices at Tuenti
Experiences with Microservices at TuentiExperiences with Microservices at Tuenti
Experiences with Microservices at Tuenti
 
Bootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on LinuxBootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on Linux
 
Fluentd and AWS at classmethod
Fluentd and AWS at classmethodFluentd and AWS at classmethod
Fluentd and AWS at classmethod
 
Fluentd meetup in japan
Fluentd meetup in japanFluentd meetup in japan
Fluentd meetup in japan
 
SQL on linux
SQL on linuxSQL on linux
SQL on linux
 
upload test 1
upload test 1upload test 1
upload test 1
 
Docker and Fluentd
Docker and FluentdDocker and Fluentd
Docker and Fluentd
 
Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin  Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin
 
Music city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeMusic city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lake
 
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir DžaferovićJavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
 
Fluentd and docker monitoring
Fluentd and docker monitoringFluentd and docker monitoring
Fluentd and docker monitoring
 
Cloud lunch and learn real-time streaming in azure
Cloud lunch and learn real-time streaming in azureCloud lunch and learn real-time streaming in azure
Cloud lunch and learn real-time streaming in azure
 
Docker and Fluentd (revised)
Docker and Fluentd (revised)Docker and Fluentd (revised)
Docker and Fluentd (revised)
 
Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)
 
Docker intro
Docker introDocker intro
Docker intro
 
Inside Triton, July 2015
Inside Triton, July 2015Inside Triton, July 2015
Inside Triton, July 2015
 

More from SATOSHI TAGOMORI

More from SATOSHI TAGOMORI (20)

Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speed
 
Good Things and Hard Things of SaaS Development/Operations
Good Things and Hard Things of SaaS Development/OperationsGood Things and Hard Things of SaaS Development/Operations
Good Things and Hard Things of SaaS Development/Operations
 
Maccro Strikes Back
Maccro Strikes BackMaccro Strikes Back
Maccro Strikes Back
 
Invitation to the dark side of Ruby
Invitation to the dark side of RubyInvitation to the dark side of Ruby
Invitation to the dark side of Ruby
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
 
Make Your Ruby Script Confusing
Make Your Ruby Script ConfusingMake Your Ruby Script Confusing
Make Your Ruby Script Confusing
 
Hijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in RubyHijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in Ruby
 
Lock, Concurrency and Throughput of Exclusive Operations
Lock, Concurrency and Throughput of Exclusive OperationsLock, Concurrency and Throughput of Exclusive Operations
Lock, Concurrency and Throughput of Exclusive Operations
 
Data Processing and Ruby in the World
Data Processing and Ruby in the WorldData Processing and Ruby in the World
Data Processing and Ruby in the World
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
 
Technologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessTechnologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise Business
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
Perfect Norikra 2nd Season
Perfect Norikra 2nd SeasonPerfect Norikra 2nd Season
Perfect Norikra 2nd Season
 
To Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT ToTo Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT To
 
How To Write Middleware In Ruby
How To Write Middleware In RubyHow To Write Middleware In Ruby
How To Write Middleware In Ruby
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real World
 
Open Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud ServiceOpen Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud Service
 
How to Make Norikra Perfect
How to Make Norikra PerfectHow to Make Norikra Perfect
How to Make Norikra Perfect
 
Distributed Logging Architecture in Container Era
Distributed Logging Architecture in Container EraDistributed Logging Architecture in Container Era
Distributed Logging Architecture in Container Era
 
Fighting API Compatibility On Fluentd Using "Black Magic"
Fighting API Compatibility On Fluentd Using "Black Magic"Fighting API Compatibility On Fluentd Using "Black Magic"
Fighting API Compatibility On Fluentd Using "Black Magic"
 

Recently uploaded

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

Fluentd 101

  • 1. FLUENTD 101 BOOTSTRAP OF UNIFIED LOGGING Open Source Summit Japan 2017 Fluentd Mini Summit / June 1, 2017 Satoshi Tagomori (@tagomoris) Treasure Data, Inc.
  • 2. Satoshi "Moris" Tagomori (@tagomoris) Fluentd, MessagePack-Ruby, Norikra, ... Treasure Data, Inc.
  • 3.
  • 5.
  • 6.
  • 7. "Fluentd is an open source data collector for unified logging layer." https://www.fluentd.org/
  • 8. "Unified Logging Layer" ? "Fluentd decouples data sources from backend systems by providing a unified logging layer in between." SQL
  • 9. "Unified Logging Layer" ? "Fluentd decouples data sources from backend systems by providing a unified logging layer in between." SQL Unified Logging Layer
  • 10. "Unified Logging Layer" ? "Fluentd decouples data sources from backend systems by providing a unified logging layer in between." SQL
  • 11. "Unified Logging Layer" ? "Fluentd decouples data sources from backend systems by providing a unified logging layer in between." SQL
  • 12. AN EXTENSIBLE & RELIABLE DATA COLLECTION TOOL Simple Core w/ Plugin System + Various Plugins Buffering, Retries, Failover
  • 13. # logs from a file <source> @type tail path /var/log/httpd.log pos_file /tmp/pos_file tag web.access <parse> @type apache2 </parse> </source> # logs from client libraries <source> @type forward port 24224 </source> # store logs to ES and HDFS <match web.*> @type copy <store> @type elasticsearch logstash_format true </store> <store> @type webhdfs host namenode.local port 50070 path /path/on/hdfs <format> @type json </format> </store> </match> Configuration (v0.14)
  • 14. Implementation / Performance • Fluentd is written in Ruby • C extension libraries for performance requirement • cool.io: Asynchronous I/O • msgpack: Serialization/Deserialization for MessagePack • Plugins in Ruby - easy to join the community • Scaling for CPU cores • multiprocess plugin (~ v0.12) • multi process workers (v0.14 ~)
  • 15. Package / Deployment • Fluentd released on RubyGems.org • rpm/deb package • td-agent by Treasure Data • Fluentd + some widely-used plugins • td-agent2: Fluentd v0.12 • td-agent3 (beta now): Fluentd v0.14 (or v1) • + msi package for Windows • Docker images • https://hub.docker.com/r/fluent/fluentd/
  • 16. For Users in the Enterprise Sector More security features and some others https://fluentd.treasuredata.com/
  • 18. 3rd party input plugins dstat df AMQL munin jvmwatcher SQL
  • 19. 3rd party output plugins Graphite
  • 21. Plugins • Built-in plugins • tail, forward, file, exec, exec_filter, copy, ... • 3rd party plugins (755 plugins at May 19) • fluent-plugin-xxx via rubygems.org • webhdfs, kafka, elasticsearch, redshift, bigquery, ... • Plugin script • .rb script files on /etc/fluent/plugin
  • 23.
  • 24.
  • 25.
  • 27. Events: Structured Logs ec_service.shopping_cart 2017-03-30 16:35:37 +0100 { "container_id": "bfdd5b9....", "container_name": "/infallible_mayer", "source": "stdout", "event": "put an item to cart", "item_id": 101, "items": 10, "client": "web" } tag timestamp record
  • 28. Event: tag, timestamp and record • Tag • A dot-separated string • to show what the event is / where the event from • Timestamp • An integer of unix time (~ v0.12) • A structured timestamp with nano seconds (v0.14 ~) • Record • Key-value pairs
  • 29. Data Source router input plugin read / receive raw data eventeventeventevent parser plugin parse data into key-values parse timestamp from record add tags output plugin with buffering eventeventeventevent format plugin buffer plugin formatted data Data Destination write / send
  • 31. Buffer & Retry for Micro-Try&Error Retry Retry Batch Stream Error Retry Retry
  • 32. Controlled Recovery from Long Outage Buffer (on-disk or in-memory) Error Overloaded!! recovery recovery + flow control queued chunks
  • 33. Last Resort: Secondary Output Error queued chunks
  • 34. # store logs to ES, or file if it goes down <match web.*> @type elasticsearch logstash_format true <secondary> @type secondary_file path /data/backup/web </secondary> </match> Configuration: Secondary Output (v0.14)
  • 36. Forward Plugin: Forwarding Data via Network • Built-in plugin, TCP port 24224 (in default) • with heartbeat protocol (default UDP in v0.12, TCP/TLS in v0.14) • Transfer data via TCP • From Fluentd to Fluentd • From logger libraries to Fluentd • From Fluent-bit to Fluentd • From Docker logging driver to Fluentd • Standard protocol
 https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1
 (Spec v0 at Fluentd v0.12 or earlier -> Spec v1 at Fluentd 0.14)
  • 37. Forward: Features • Load Balancing / High Availability • Servers with weights • Standby servers • DNS round robin • Controlling Data Transferring Semantics • at-most-once / at-least-once transferring • Spec v1 Features • TLS support • Simple authentication/authorization • Efficient data transferring: Gzip Compression (v0.14)
  • 38. Forward Plugin: Load Balancing 60 60 60 60 60 60 60 20 weight: 60 (default) weight: 60 (default) weight: 60 (default) weight: 20 Balance Data with Configured Weight
  • 39. Forward Plugin: Handling Server Failure Detecting Server Down/Up using Heartbeat Error
  • 40. Forward Plugin: Standby Server Detecting Server Down/Up using Heartbeat standby: true Error standby: true
  • 41. Forward Plugin: Without ACK (at-most-once) forward output buffer forward input any output forward output forward input any output bufferbuffer Without any troubles With troubles about buffers in destination forward output buffer forward input any output forward output forward input any output buffer buffer Events will be lost in this case :(
  • 42. Forward Plugin: With ACK (at-least-once) forward output buffer forward input any output forward output forward input any output buffer Forward output: require_ack_response: true forward output forward input any output buffer buffer buffer ACK with chunk id forward output forward input any output buffer buffer with chunk id
  • 43. Forward Plugin: With ACK (at-least-once) forward output buffer forward input any output forward output forward input any output Forward output: require_ack_response: true forward output forward input any output buffer buffer ACK missing forward output forward input any output with chunk id buffer buffer with chunk id retry Forward output ensure to transfer buffers to any living destinations :D
  • 44. Fluentd has many good stuffs
 for logging. Discover more on docs.fluentd.org! Happy Logging! @tagomoris