SlideShare a Scribd company logo
Fluentd vs. Logstash
Masaki Matsushita
NTT Communications
About Me
● Masaki MATSUSHITA
● Software Engineer at
○ We are providing Internet access here!
● Github: mmasaki Twitter: @_mmasaki
● 16 Commits in Liberty
○ Trove, oslo_log, oslo_config
● CRuby Commiter
○ 100+ commits for performance improvement
2
What are Log Collectors?
● Provide pluggable and unified logging layer
Without Log Collectors With Log Collectors
Images from http://fluentd.org/ 3
Input, Filter and Output
4
Input Plugins
tail
syslog
Filter Plugins
grep
hostname
Output Plugins
InfluxDB
Elasticsearch
● They are implemented as plugins
● Can be replaced easily
Log FIles
Components
Two Popular Log Collectors
● Fluentd
○ Written in CRuby
○ Used in Kubernetes
○ Maintained by Treasure Data Inc.
● Logstash
○ Written in JRuby
○ Maintained by elastic.co
● They have similar features
● Which one is better for you? 5
Agenda
● Comparisons
○ Configuration
○ Supported Plugins
○ Performance
○ Transport Protocol
● Integrate OpenStack with Fluentd/Logstash
○ Considering High Availability 6
Configuration: Fluentd
● Every inputs are tagged
● Logs will be routed by tag
nova-api.log
(tag: openstack.nova)
cinder-api.log
(tag: openstack.cinder)
<match openstack.nova>
<match openstack.cinder>
Filter/Route
7
Fluentd Configuration: Input
<source>
@type tail
path /var/log/nova/nova-api.log
tag openstack.nova
</source>
Example of tailing nova-api log
● Every inputs will be tagged
8
Fluentd Configuration: Output
<match openstack.nova> # nova related logs
@type elasticsearch
host example.com
</match>
<match openstack.*> # all other OpenStack related logs
@type influxdb
# …
</match>
Routed by tag
(First match is priority)
Wildcards can be used
9
Fluentd Configuration: Copy
<match openstack.*>
@type copy
<store>
@type influxdb
</store>
<store>
@type elasticsearch
</store>
</match>
Copy plugin enables multiple
outputs for a tag
Copied Output
tag: openstack.*
10
Logstash Configuration
● No tags
● All inputs will be aggregated
● Logs will be scattered to outputs
nova-api.log
cinder-api.log
Filter/Aggregate
aggregated logs
11
Logstash Configuration
input {
file { path => “/var/log/nova/*.log” }
file { path => “/var/log/cinder/*.log” }
}
output {
elasticsearch { hosts => [“example.com”] }
influxdb { host => “example.com”... }
}
12
Case 1: Separated Streams
Input1
Input2
Input3
Output2
Output3
Output1
● Handle multiple streams separately
13
Case 1: Separated Streams
Fluentd: Simple matching by tag
<match input.input1>
@type output1
</match>
<match input.input2>
@type output2
</match>
<match input.input3>
@type output3
</match>
Logstash: Conditional Outputs
output {
if [type] == “input1” {
output1 {}
} else if [type] == “input2” {
output2 {}
} else if [type] == “input3” {
output3 {}
}
}
Need to split aggregated logs
14
Case 2: Aggregated Streams
Input1
Input2
Input3
Output2
Output3
Output1
● Streams will be aggregated and scattered
15
Case 2: Aggregated Streams
Fluentd: Copy plugins is needed
<match input.*>
@type copy
<store>
@type output1
</store>
<store>
@type output2
</store>
<store>
@type output3
</store>
</match>
Logstash: Quite simple
output {
output1 {}
output2 {}
output3 {}
}
16
Configuration
● Fluentd
○ Routed by simple tag matching
○ Suited to handle log streams separately
● Logstash
○ Logs are aggregated
○ Suited to handle logs in gather-scatter style
17
Plugins
● Both provide many plugins
○ Fluentd: 300+, Logstash: 200+
● Popular plugins are bundled with Logstash
○ They are maintained by the Logstash project
● Fluentd contains only minimal plugins
○ Most plugins are maintained by individuals
● Plugins can be installed easily by one command
18
Performance
● Depends on circumstances
● More than enough for OpenStack logs
○ Both can handle 10000+ logs/s
● Applying heavy filters is not a good idea
● CRuby is slow because of GVL?
○ GVL: Global VM (Interpreter) Lock
○ It’s not true for IO bound loads
19
GVL on IO bound loads
● IO operation can be performed in parallel
20
Thread 1 Thread 2
Idle :
User Space:
Kernel Space:
Actual Read/Write
Ruby Code Execution
GVL Released/
Acquired
IO operations
in parallel
Transport Protocol
● Both collectors have their own transport protocol.
○ Failure Detection and Fallback
● Logstash: Lumberjack protocol
○ Active-Standby only
● Fluentd: forward protocol
○ Active-Active (Load Balancing), Active-Standby
○ Some additional features
21
Logstash Transport: lumberjack
● Active-Standby lumberjack { #config@source
hosts => [
“primary”,
“secondary”
]
port => 1234
ssl_certificate => …
}
primary
secondary
source
secondary is used
when primary fails
Fail
Fallback
22
Fluentd Transport: forward
● Active-Active
(Load Balancing)
<match openstack.*>
type forward
<server>
host dest1
</server>
<server>
host dest2
</server>
</match>
source dest1
dest2
Equally balanced
outputs
23
Fluentd Transport: forward
● Active-Standby <match openstack.*>
type forward
<server>
host primary
</server>
<server>
host secondary
standby
</server>
</match>
primary
secondary
source
Fail
Fallback
24
Fluentd Transport: forward
● Weighted Load Balancing
<match openstack.*>
type forward
<server>
host dest1
weight 60
</server>
<server>
host dest2
weight 40
</server>
</match>
source dest1
dest2
60%
40%
25
Fluentd Transport: forward
● At-least-one Semantics
(may affect performance)
<match openstack.*>
type forward
require_ack_response
<server>
host dest
</server>
</match>
destsource
send logs
ACK
Logs are re-transmitted
until ACK is received
26
Transport Protocol
● Both can be configured as Active-Standby mode.
● Fluentd has great features:
○ Active-Active Mode (Load Balancing)
○ At-least-one Semantics
○ Weighted Load Balancing
27
Forwarders
● Fluentd/Logstash have their own “forwarders”
○ Lightweight implementation written in Golang
○ Low memory consumption
○ One binary: Less dependent and easy to install
28
Node
Tail log files
Forwarder
Log AggregatorForward/
Lumberjack
Protocol
Forwarders: Config Example
fluentd-forwarder:
[fluentd-forwarder]
to = fluent://fluentd1:24224
to = fluent://fluentd2:24224
logstash-forwarder:
"network": {
"servers": [
"logstash1:5043",
"logstash2:5043"
]
}Always send logs to both servers.
Pick one active server and send logs only to it.
Fallback to another server on failure. 29
Integration with OpenStack
● Tail log files by local Fluentd/Logstash
○ must parse many form of log files
● Rsyslog
○ installed by default in most distribution
○ can receive logs in JSON format
● Direct output from oslo_log
○ oslo_log: logging library used by components
○ Logging without any parsing 30
Log
Aggregators
OpenStack nodes
Tail Log Files
31
Tail log files
Forward Protocol
dest1
dest2
Tail Log Files
• Must handle many log files…
syslog
kern.log
apache2/access.log
apache2/error.log
keystone/keystone-all.log
keystone/keystone-manage.log
keystone/keystone.log
cinder/cinder-api.log
cinder/cinder-scheduler.log
neutron/neutron-server.log
neutron/neutron-server.log
nova/nova-api.log
nova/nova-conductor.log
nova/nova-consoleauth.log
nova/nova-manage.log
nova/nova-novncproxy.log
nova/nova-scheduler.log
mysql/error.log
mysql/mysql-slow.log
mysql.log
mysql.err
nova/nova-compute.log
nova/nova-manage.log...
32
Tail Log Files
• But you can use wildcard
Fluentd:
<source>
type tail
path /var/log/nova/*.log
tag openstack.nova
</source>
Logstash:
input {
file {
path => [“/var/log/nova/*.log”]
}
}
33
Parse Text Log
● Welcome to regular expression hell!
<source>
type tail # or syslog
path /var/log/nova/nova-api.log
format /^(?<asctime>.+) (?<process>d+) (?<loglevel>w+) (?
<objname>S+)( [(-|(?<request_id>.+?) (?<user_identity>.+))])?
((?<remote>S*) "(?<method>S+) (?<path>[^"]*) S*?" status: (?
<code>d*) len: (?<size>d*) time: (?<res_time>S)|(?<message>.
*))/
</source>
34
Log
Aggregators
OpenStack nodes
Rsyslog
35
via /dev/log
Syslog Protocol
(TCP or UDP)
rsyslog
Rsyslog: Logging.conf
● Logging Configuration in detail
● Handler: Syslog, Formatter: JSON
# /etc/{nova,cinder…}/logging.conf
[handler_syslog]
class = handlers.SysLogHandler
args = ('/dev/log', handlers.SysLogHandler.LOG_LOCAL1)
formatter = json
[formatter_json]
class = oslo_log.formatters.JSONFormatter 36
Example Output: JSONFormatter
{
"levelname": "INFO",
"funcname": "start",
"message": "Starting conductor node (version 13.0.0)",
"msg": "Starting %(topic)s node (version %(version)s)",
"asctime": "2015-09-29 18:29:57,690",
"relative_created": 2454.8499584198,
"process": 25204,
"created": 1443518997.690932,
"thread": 140119466896752,
"name": "nova.service",
"process_name": "MainProcess",
"thread_name": "GreenThread-1",
...
37
Syslog Facilities
● Assignment of local0..7 Facilities for components
● Logs are tagged as like “syslog.local0” in Fluentd
● Example:
○ local0: Keystone
○ local1: Nova
○ local2: Cinder
○ local3: Neutron
○ local4: Glance
38
Rsyslog: Config@OpenStack nodes
● Active-Standby Configuration
# /etc/rsyslog.d/rsyslog.conf
user.* @@primary:5140
$ActionExecOnlyWhenPreviousIsSuspended on
&@@secondary:5140
39
Rsyslog: Config@Aggregator
Fluentd:
<source>
type syslog
port 5140
protocol_type tcp
format json
tag syslog
</source>
Logstash:
input {
syslog {
codec => json
port => 5140
}
} Listen on both TCP and UDP
Specify TCP or UDP 40
Rsyslog: Config@Aggregator
Fluentd:
<source>
type syslog
port 5140
protocol_type tcp
format json
tag syslog
</source>
Logstash:
input {
syslog {
codec => json
port => 5140
}
}
41
Log
AggregatorsOpenStack nodes
42
via FluentHandler
Forward Protocol
Direct output from oslo_log
Local Fluentd for buffering/load balancing
(Logstash also can be used)
Direct output from oslo_log
# logging.conf:
[handler_fluent]
class = fluent.handler.FluentHandler # fluent-logger
formatter = fluent
args = (’openstack.nova', 'localhost', 24224)
[formatter_fluent]
class = fluent.handler.FluentFormatter # our Blueprint
43
Format logs as Dictionary
Our BP in oslo_log: FluentFormatter
{
"hostname":"allinone-vivid",
"extra":{"project":"unknown","version":"unknown"},
"process_name":"MainProcess",
"module":"wsgi",
"message":"(4132) wsgi starting up on http://0.0.0.0:8774/",
"filename":"wsgi.py",
"name":"nova.osapi_compute.wsgi.server",
"level":"INFO",
"traceback":null,
"funcname":"server",
"time":"2015-10-15 10:09:12,255"
}
Don’t need to parse!
44
Conclusion
● Log Handling
○ Fluentd: Logs are distinguished by tag
○ Logstash: No tags. Logs are aggregated
● Transport Protocol
○ Both supports active-standby mode
○ Fluentd supports some additional features
■ Client-side load balancing (Active-Active)
■ At-least-one semantics
■ Weighted load balancing 45
Conclusion
● Integration with OpenStack
○ Tail log files: regular expression hell
○ Rsyslog: No agents are needed
○ Direct output from oslo_log w/o any parsing
○ Review is welcome for our Blueprint
(oslo_log: fluent-formatter)
46
Thank you!
Please visit our booth!
Robot Racing over WebRTC! →

More Related Content

What's hot (20)

PDF
ELK Stack
Eberhard Wolff
 
PPTX
Elk
Caleb Wang
 
PDF
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Odinot Stanislas
 
PDF
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
SANG WON PARK
 
PDF
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
OpenStack Korea Community
 
PDF
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
MongoDB
 
PDF
ElastiCacheを利用する上でキャッシュをどのように有効に使うべきか
Amazon Web Services Japan
 
PDF
Best Practice of Compression/Decompression Codes in Apache Spark with Sophia...
Databricks
 
PDF
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
PDF
클라우드 컴퓨팅 기반 기술과 오픈스택(Kvm) 기반 Provisioning
Ji-Woong Choi
 
PDF
Linux tuning to improve PostgreSQL performance
PostgreSQL-Consulting
 
PPTX
Ceph Introduction 2017
Karan Singh
 
PDF
Java Performance Analysis on Linux with Flame Graphs
Brendan Gregg
 
PPTX
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
SeungYong Oh
 
PDF
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
GetInData
 
PDF
Ceph issue 해결 사례
Open Source Consulting
 
PDF
Introduction to Redis
Dvir Volk
 
PDF
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
if kakao
 
PDF
BGP Unnumbered で遊んでみた
akira6592
 
PPTX
Elastic stack Presentation
Amr Alaa Yassen
 
ELK Stack
Eberhard Wolff
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Odinot Stanislas
 
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
SANG WON PARK
 
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
OpenStack Korea Community
 
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
MongoDB
 
ElastiCacheを利用する上でキャッシュをどのように有効に使うべきか
Amazon Web Services Japan
 
Best Practice of Compression/Decompression Codes in Apache Spark with Sophia...
Databricks
 
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
클라우드 컴퓨팅 기반 기술과 오픈스택(Kvm) 기반 Provisioning
Ji-Woong Choi
 
Linux tuning to improve PostgreSQL performance
PostgreSQL-Consulting
 
Ceph Introduction 2017
Karan Singh
 
Java Performance Analysis on Linux with Flame Graphs
Brendan Gregg
 
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
SeungYong Oh
 
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
GetInData
 
Ceph issue 해결 사례
Open Source Consulting
 
Introduction to Redis
Dvir Volk
 
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
if kakao
 
BGP Unnumbered で遊んでみた
akira6592
 
Elastic stack Presentation
Amr Alaa Yassen
 

Viewers also liked (9)

PPTX
BI, Reporting and Analytics on Apache Cassandra
Victor Coustenoble
 
PDF
AdStage: Monacella: An Relational Object Database using Cassandra as the Data...
DataStax Academy
 
PDF
From Zero to Hero - Centralized Logging with Logstash & Elasticsearch
Sematext Group, Inc.
 
PDF
Integrando Redis en aplicaciones Symfony2
Ronny López
 
PDF
Fluentd and PHP
chobi e
 
PDF
Application Logging With The ELK Stack
benwaine
 
PDF
Fluentd and docker monitoring
Vinay Krishna
 
PDF
Application Logging With Logstash
benwaine
 
PDF
Logging with Elasticsearch, Logstash & Kibana
Amazee Labs
 
BI, Reporting and Analytics on Apache Cassandra
Victor Coustenoble
 
AdStage: Monacella: An Relational Object Database using Cassandra as the Data...
DataStax Academy
 
From Zero to Hero - Centralized Logging with Logstash & Elasticsearch
Sematext Group, Inc.
 
Integrando Redis en aplicaciones Symfony2
Ronny López
 
Fluentd and PHP
chobi e
 
Application Logging With The ELK Stack
benwaine
 
Fluentd and docker monitoring
Vinay Krishna
 
Application Logging With Logstash
benwaine
 
Logging with Elasticsearch, Logstash & Kibana
Amazee Labs
 
Ad

Similar to Fluentd vs. Logstash for OpenStack Log Management (20)

PDF
FluentD vs. Logstash
All Things Open
 
PDF
Centralized + Unified Logging
Gabor Kozma
 
PPTX
CSE3069 - FLUENTD real time analytics.pptx
dummyuseage1
 
ODP
Log Management Systems
Mehdi Hamidi
 
PDF
Fluentd and Docker - running fluentd within a docker container
Treasure Data, Inc.
 
PDF
Fluentd 101
SATOSHI TAGOMORI
 
PPTX
centralization of log systems pour suivis
Thierry Gayet
 
PDF
Fluentd Project Intro at Kubecon 2019 EU
N Masahiro
 
PDF
Docker Logging and analysing with Elastic Stack
Jakub Hajek
 
PDF
Docker Logging and analysing with Elastic Stack - Jakub Hajek
PROIDEA
 
PDF
Logging in Action: With Fluentd, Kubernetes and more 1st Edition Phil Wilkins
roarxhaarexg
 
PDF
Log Management: AtlSecCon2015
cameronevans
 
PDF
Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)
Lee Myring
 
PDF
Fluentd and Docker - running fluentd within a docker container
Treasure Data, Inc.
 
PPTX
Elk with Openstack
Arun prasath
 
PPTX
Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...
Phil Wilkins
 
PDF
Collect distributed application logging using fluentd (EFK stack)
Marco Pas
 
KEY
Messaging, interoperability and log aggregation - a new framework
Tomas Doran
 
KEY
Message:Passing - lpw 2012
Tomas Doran
 
PDF
Fluentd Overview, Now and Then
SATOSHI TAGOMORI
 
FluentD vs. Logstash
All Things Open
 
Centralized + Unified Logging
Gabor Kozma
 
CSE3069 - FLUENTD real time analytics.pptx
dummyuseage1
 
Log Management Systems
Mehdi Hamidi
 
Fluentd and Docker - running fluentd within a docker container
Treasure Data, Inc.
 
Fluentd 101
SATOSHI TAGOMORI
 
centralization of log systems pour suivis
Thierry Gayet
 
Fluentd Project Intro at Kubecon 2019 EU
N Masahiro
 
Docker Logging and analysing with Elastic Stack
Jakub Hajek
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
PROIDEA
 
Logging in Action: With Fluentd, Kubernetes and more 1st Edition Phil Wilkins
roarxhaarexg
 
Log Management: AtlSecCon2015
cameronevans
 
Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)
Lee Myring
 
Fluentd and Docker - running fluentd within a docker container
Treasure Data, Inc.
 
Elk with Openstack
Arun prasath
 
Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...
Phil Wilkins
 
Collect distributed application logging using fluentd (EFK stack)
Marco Pas
 
Messaging, interoperability and log aggregation - a new framework
Tomas Doran
 
Message:Passing - lpw 2012
Tomas Doran
 
Fluentd Overview, Now and Then
SATOSHI TAGOMORI
 
Ad

More from NTT Communications Technology Development (20)

PDF
クラウドを最大限活用するinfrastructure as codeを考えよう
NTT Communications Technology Development
 
PPTX
【たぶん日本初導入!】Azure Stack Hub with GPUの性能と機能紹介
NTT Communications Technology Development
 
PDF
macOSの仮想化技術について ~Virtualization-rs Rust bindings for virtualization.framework ~
NTT Communications Technology Development
 
PPTX
マルチクラウドでContinuous Deliveryを実現するSpinnakerについて
NTT Communications Technology Development
 
PDF
SpinnakerとKayentaで 高速・安全なデプロイ!
NTT Communications Technology Development
 
PDF
100Gbps OpenStack For Providing High-Performance NFV
NTT Communications Technology Development
 
PDF
Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...
NTT Communications Technology Development
 
PDF
AWS re:Invent2017で見た AWSの強さとは
NTT Communications Technology Development
 
PDF
分散トレーシング技術について(Open tracingやjaeger)
NTT Communications Technology Development
 
PDF
Mexico ops meetup発表資料 20170905
NTT Communications Technology Development
 
PDF
NTT Tech Conference #2 - closing -
NTT Communications Technology Development
 
PPTX
イケてない開発チームがイケてる開発を始めようとする軌跡
NTT Communications Technology Development
 
PDF
GPU Container as a Service を実現するための最新OSS徹底比較
NTT Communications Technology Development
 
PDF
SpinnakerとOpenStackの構築
NTT Communications Technology Development
 
PDF
Troveコミュニティ動向
NTT Communications Technology Development
 
PPTX
Web rtc for iot, edge computing use cases
NTT Communications Technology Development
 
PDF
OpenStack Ops Mid-Cycle Meetup & Project Team Gathering出張報告
NTT Communications Technology Development
 
PDF
NTT Tech Conference #1 Opening Keynote
NTT Communications Technology Development
 
PDF
NTT Tech Conference #1 Closing Keynote
NTT Communications Technology Development
 
クラウドを最大限活用するinfrastructure as codeを考えよう
NTT Communications Technology Development
 
【たぶん日本初導入!】Azure Stack Hub with GPUの性能と機能紹介
NTT Communications Technology Development
 
macOSの仮想化技術について ~Virtualization-rs Rust bindings for virtualization.framework ~
NTT Communications Technology Development
 
マルチクラウドでContinuous Deliveryを実現するSpinnakerについて
NTT Communications Technology Development
 
SpinnakerとKayentaで 高速・安全なデプロイ!
NTT Communications Technology Development
 
100Gbps OpenStack For Providing High-Performance NFV
NTT Communications Technology Development
 
Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...
NTT Communications Technology Development
 
AWS re:Invent2017で見た AWSの強さとは
NTT Communications Technology Development
 
分散トレーシング技術について(Open tracingやjaeger)
NTT Communications Technology Development
 
Mexico ops meetup発表資料 20170905
NTT Communications Technology Development
 
NTT Tech Conference #2 - closing -
NTT Communications Technology Development
 
イケてない開発チームがイケてる開発を始めようとする軌跡
NTT Communications Technology Development
 
GPU Container as a Service を実現するための最新OSS徹底比較
NTT Communications Technology Development
 
SpinnakerとOpenStackの構築
NTT Communications Technology Development
 
Troveコミュニティ動向
NTT Communications Technology Development
 
Web rtc for iot, edge computing use cases
NTT Communications Technology Development
 
OpenStack Ops Mid-Cycle Meetup & Project Team Gathering出張報告
NTT Communications Technology Development
 
NTT Tech Conference #1 Opening Keynote
NTT Communications Technology Development
 
NTT Tech Conference #1 Closing Keynote
NTT Communications Technology Development
 

Recently uploaded (20)

PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 

Fluentd vs. Logstash for OpenStack Log Management

  • 1. Fluentd vs. Logstash Masaki Matsushita NTT Communications
  • 2. About Me ● Masaki MATSUSHITA ● Software Engineer at ○ We are providing Internet access here! ● Github: mmasaki Twitter: @_mmasaki ● 16 Commits in Liberty ○ Trove, oslo_log, oslo_config ● CRuby Commiter ○ 100+ commits for performance improvement 2
  • 3. What are Log Collectors? ● Provide pluggable and unified logging layer Without Log Collectors With Log Collectors Images from http://fluentd.org/ 3
  • 4. Input, Filter and Output 4 Input Plugins tail syslog Filter Plugins grep hostname Output Plugins InfluxDB Elasticsearch ● They are implemented as plugins ● Can be replaced easily Log FIles Components
  • 5. Two Popular Log Collectors ● Fluentd ○ Written in CRuby ○ Used in Kubernetes ○ Maintained by Treasure Data Inc. ● Logstash ○ Written in JRuby ○ Maintained by elastic.co ● They have similar features ● Which one is better for you? 5
  • 6. Agenda ● Comparisons ○ Configuration ○ Supported Plugins ○ Performance ○ Transport Protocol ● Integrate OpenStack with Fluentd/Logstash ○ Considering High Availability 6
  • 7. Configuration: Fluentd ● Every inputs are tagged ● Logs will be routed by tag nova-api.log (tag: openstack.nova) cinder-api.log (tag: openstack.cinder) <match openstack.nova> <match openstack.cinder> Filter/Route 7
  • 8. Fluentd Configuration: Input <source> @type tail path /var/log/nova/nova-api.log tag openstack.nova </source> Example of tailing nova-api log ● Every inputs will be tagged 8
  • 9. Fluentd Configuration: Output <match openstack.nova> # nova related logs @type elasticsearch host example.com </match> <match openstack.*> # all other OpenStack related logs @type influxdb # … </match> Routed by tag (First match is priority) Wildcards can be used 9
  • 10. Fluentd Configuration: Copy <match openstack.*> @type copy <store> @type influxdb </store> <store> @type elasticsearch </store> </match> Copy plugin enables multiple outputs for a tag Copied Output tag: openstack.* 10
  • 11. Logstash Configuration ● No tags ● All inputs will be aggregated ● Logs will be scattered to outputs nova-api.log cinder-api.log Filter/Aggregate aggregated logs 11
  • 12. Logstash Configuration input { file { path => “/var/log/nova/*.log” } file { path => “/var/log/cinder/*.log” } } output { elasticsearch { hosts => [“example.com”] } influxdb { host => “example.com”... } } 12
  • 13. Case 1: Separated Streams Input1 Input2 Input3 Output2 Output3 Output1 ● Handle multiple streams separately 13
  • 14. Case 1: Separated Streams Fluentd: Simple matching by tag <match input.input1> @type output1 </match> <match input.input2> @type output2 </match> <match input.input3> @type output3 </match> Logstash: Conditional Outputs output { if [type] == “input1” { output1 {} } else if [type] == “input2” { output2 {} } else if [type] == “input3” { output3 {} } } Need to split aggregated logs 14
  • 15. Case 2: Aggregated Streams Input1 Input2 Input3 Output2 Output3 Output1 ● Streams will be aggregated and scattered 15
  • 16. Case 2: Aggregated Streams Fluentd: Copy plugins is needed <match input.*> @type copy <store> @type output1 </store> <store> @type output2 </store> <store> @type output3 </store> </match> Logstash: Quite simple output { output1 {} output2 {} output3 {} } 16
  • 17. Configuration ● Fluentd ○ Routed by simple tag matching ○ Suited to handle log streams separately ● Logstash ○ Logs are aggregated ○ Suited to handle logs in gather-scatter style 17
  • 18. Plugins ● Both provide many plugins ○ Fluentd: 300+, Logstash: 200+ ● Popular plugins are bundled with Logstash ○ They are maintained by the Logstash project ● Fluentd contains only minimal plugins ○ Most plugins are maintained by individuals ● Plugins can be installed easily by one command 18
  • 19. Performance ● Depends on circumstances ● More than enough for OpenStack logs ○ Both can handle 10000+ logs/s ● Applying heavy filters is not a good idea ● CRuby is slow because of GVL? ○ GVL: Global VM (Interpreter) Lock ○ It’s not true for IO bound loads 19
  • 20. GVL on IO bound loads ● IO operation can be performed in parallel 20 Thread 1 Thread 2 Idle : User Space: Kernel Space: Actual Read/Write Ruby Code Execution GVL Released/ Acquired IO operations in parallel
  • 21. Transport Protocol ● Both collectors have their own transport protocol. ○ Failure Detection and Fallback ● Logstash: Lumberjack protocol ○ Active-Standby only ● Fluentd: forward protocol ○ Active-Active (Load Balancing), Active-Standby ○ Some additional features 21
  • 22. Logstash Transport: lumberjack ● Active-Standby lumberjack { #config@source hosts => [ “primary”, “secondary” ] port => 1234 ssl_certificate => … } primary secondary source secondary is used when primary fails Fail Fallback 22
  • 23. Fluentd Transport: forward ● Active-Active (Load Balancing) <match openstack.*> type forward <server> host dest1 </server> <server> host dest2 </server> </match> source dest1 dest2 Equally balanced outputs 23
  • 24. Fluentd Transport: forward ● Active-Standby <match openstack.*> type forward <server> host primary </server> <server> host secondary standby </server> </match> primary secondary source Fail Fallback 24
  • 25. Fluentd Transport: forward ● Weighted Load Balancing <match openstack.*> type forward <server> host dest1 weight 60 </server> <server> host dest2 weight 40 </server> </match> source dest1 dest2 60% 40% 25
  • 26. Fluentd Transport: forward ● At-least-one Semantics (may affect performance) <match openstack.*> type forward require_ack_response <server> host dest </server> </match> destsource send logs ACK Logs are re-transmitted until ACK is received 26
  • 27. Transport Protocol ● Both can be configured as Active-Standby mode. ● Fluentd has great features: ○ Active-Active Mode (Load Balancing) ○ At-least-one Semantics ○ Weighted Load Balancing 27
  • 28. Forwarders ● Fluentd/Logstash have their own “forwarders” ○ Lightweight implementation written in Golang ○ Low memory consumption ○ One binary: Less dependent and easy to install 28 Node Tail log files Forwarder Log AggregatorForward/ Lumberjack Protocol
  • 29. Forwarders: Config Example fluentd-forwarder: [fluentd-forwarder] to = fluent://fluentd1:24224 to = fluent://fluentd2:24224 logstash-forwarder: "network": { "servers": [ "logstash1:5043", "logstash2:5043" ] }Always send logs to both servers. Pick one active server and send logs only to it. Fallback to another server on failure. 29
  • 30. Integration with OpenStack ● Tail log files by local Fluentd/Logstash ○ must parse many form of log files ● Rsyslog ○ installed by default in most distribution ○ can receive logs in JSON format ● Direct output from oslo_log ○ oslo_log: logging library used by components ○ Logging without any parsing 30
  • 31. Log Aggregators OpenStack nodes Tail Log Files 31 Tail log files Forward Protocol dest1 dest2
  • 32. Tail Log Files • Must handle many log files… syslog kern.log apache2/access.log apache2/error.log keystone/keystone-all.log keystone/keystone-manage.log keystone/keystone.log cinder/cinder-api.log cinder/cinder-scheduler.log neutron/neutron-server.log neutron/neutron-server.log nova/nova-api.log nova/nova-conductor.log nova/nova-consoleauth.log nova/nova-manage.log nova/nova-novncproxy.log nova/nova-scheduler.log mysql/error.log mysql/mysql-slow.log mysql.log mysql.err nova/nova-compute.log nova/nova-manage.log... 32
  • 33. Tail Log Files • But you can use wildcard Fluentd: <source> type tail path /var/log/nova/*.log tag openstack.nova </source> Logstash: input { file { path => [“/var/log/nova/*.log”] } } 33
  • 34. Parse Text Log ● Welcome to regular expression hell! <source> type tail # or syslog path /var/log/nova/nova-api.log format /^(?<asctime>.+) (?<process>d+) (?<loglevel>w+) (? <objname>S+)( [(-|(?<request_id>.+?) (?<user_identity>.+))])? ((?<remote>S*) "(?<method>S+) (?<path>[^"]*) S*?" status: (? <code>d*) len: (?<size>d*) time: (?<res_time>S)|(?<message>. *))/ </source> 34
  • 36. Rsyslog: Logging.conf ● Logging Configuration in detail ● Handler: Syslog, Formatter: JSON # /etc/{nova,cinder…}/logging.conf [handler_syslog] class = handlers.SysLogHandler args = ('/dev/log', handlers.SysLogHandler.LOG_LOCAL1) formatter = json [formatter_json] class = oslo_log.formatters.JSONFormatter 36
  • 37. Example Output: JSONFormatter { "levelname": "INFO", "funcname": "start", "message": "Starting conductor node (version 13.0.0)", "msg": "Starting %(topic)s node (version %(version)s)", "asctime": "2015-09-29 18:29:57,690", "relative_created": 2454.8499584198, "process": 25204, "created": 1443518997.690932, "thread": 140119466896752, "name": "nova.service", "process_name": "MainProcess", "thread_name": "GreenThread-1", ... 37
  • 38. Syslog Facilities ● Assignment of local0..7 Facilities for components ● Logs are tagged as like “syslog.local0” in Fluentd ● Example: ○ local0: Keystone ○ local1: Nova ○ local2: Cinder ○ local3: Neutron ○ local4: Glance 38
  • 39. Rsyslog: Config@OpenStack nodes ● Active-Standby Configuration # /etc/rsyslog.d/rsyslog.conf user.* @@primary:5140 $ActionExecOnlyWhenPreviousIsSuspended on &@@secondary:5140 39
  • 40. Rsyslog: Config@Aggregator Fluentd: <source> type syslog port 5140 protocol_type tcp format json tag syslog </source> Logstash: input { syslog { codec => json port => 5140 } } Listen on both TCP and UDP Specify TCP or UDP 40
  • 41. Rsyslog: Config@Aggregator Fluentd: <source> type syslog port 5140 protocol_type tcp format json tag syslog </source> Logstash: input { syslog { codec => json port => 5140 } } 41
  • 42. Log AggregatorsOpenStack nodes 42 via FluentHandler Forward Protocol Direct output from oslo_log Local Fluentd for buffering/load balancing (Logstash also can be used)
  • 43. Direct output from oslo_log # logging.conf: [handler_fluent] class = fluent.handler.FluentHandler # fluent-logger formatter = fluent args = (’openstack.nova', 'localhost', 24224) [formatter_fluent] class = fluent.handler.FluentFormatter # our Blueprint 43 Format logs as Dictionary
  • 44. Our BP in oslo_log: FluentFormatter { "hostname":"allinone-vivid", "extra":{"project":"unknown","version":"unknown"}, "process_name":"MainProcess", "module":"wsgi", "message":"(4132) wsgi starting up on http://0.0.0.0:8774/", "filename":"wsgi.py", "name":"nova.osapi_compute.wsgi.server", "level":"INFO", "traceback":null, "funcname":"server", "time":"2015-10-15 10:09:12,255" } Don’t need to parse! 44
  • 45. Conclusion ● Log Handling ○ Fluentd: Logs are distinguished by tag ○ Logstash: No tags. Logs are aggregated ● Transport Protocol ○ Both supports active-standby mode ○ Fluentd supports some additional features ■ Client-side load balancing (Active-Active) ■ At-least-one semantics ■ Weighted load balancing 45
  • 46. Conclusion ● Integration with OpenStack ○ Tail log files: regular expression hell ○ Rsyslog: No agents are needed ○ Direct output from oslo_log w/o any parsing ○ Review is welcome for our Blueprint (oslo_log: fluent-formatter) 46
  • 47. Thank you! Please visit our booth! Robot Racing over WebRTC! →