Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
fluentd 101
Search
threetreeslight
August 22, 2018
0
38
fluentd 101
fluentd 101 on Shinjuku.rb #64
threetreeslight
August 22, 2018
Tweet
Share
More Decks by threetreeslight
See All by threetreeslight
実録 採用一投入魂
threetreeslight
0
17
Bottleneck is You
threetreeslight
0
110
Japan Office Society オフィスはスタートアップの成長を助長するのか?阻害するのか?
threetreeslight
0
110
スタートアップは見極められたくない
threetreeslight
0
43
VPoEの責務とは
threetreeslight
0
73
CiecleCIでもくもく会を支える技術
threetreeslight
0
53
Ego vs higher self
threetreeslight
0
43
Performance Hack 101
threetreeslight
0
91
複数のスタートアップを 通して得た失敗と学び
threetreeslight
0
72
Featured
See All Featured
It's Worth the Effort
3n
187
28k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.6k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
The Language of Interfaces
destraynor
160
25k
Building Applications with DynamoDB
mza
96
6.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
910
Building an army of robots
kneath
306
46k
4 Signs Your Business is Dying
shpigford
184
22k
Transcript
fluentd 101 @threetreeslight on shinjuku.rb #64 1 / 27
とは? ⼀元的なロギングレイヤー( Unified Logging Layer ) を提供する middleware log aggregator,
log shipper fluentd 2 / 27
ユースケース 1. アプリのログ集約 2. サービスログの監視 3. データ分析 4. データストアへの接続 5.
ストリーム処理 3 / 27
なぜUnified する必要があるのか? ログデータを利⽤できるようにするためにバックエンド側のシステムで は多⼤な努⼒を⽀払ってきた so much effort is wasted trying
to make various backend systems understand log data. 4 / 27
write complex regular expressions skill is a heroic skill 5
/ 27
欲しいもの 1. log producers と consumers で 共通なインターフェース 2. ⽔平⽅向にスケールし、リトライ・レジュームも可能
3. 新しいデータ⼊出⼒系統への対応がplugin でお⼿軽にできる 6 / 27
fluentd 全てを満たす 7 / 27
イベントの加⼯も簡単 8 / 27
Filters いらないデータすてたり、データのマスキング( アプリケーションでや ったほうが良い) とか容易 A Filter aims to behave
like a rule to pass or reject an event. The Filter basically will accept or reject the Event based on its type and rule defined 9 / 27
01 <filter test.cycle> 02 @type grep 03 <exclude> 04 key
action 05 pattern ^logout$ 06 </exclude> 07 </filter> 10 / 27
Labels label 使って特定環境のログデータの処理とか容易 to define new Routing sections that do
not follow the top to bottom order 11 / 27
01 <label @STAGING> 02 <filter test.cycle> 03 @type grep 04
<exclude> 05 key action 06 pattern ^logout$ 07 </exclude> 08 </filter> 09 10 <match test.cycle> 11 @type stdout 12 </match> 13 </label> 12 / 27
Buffers buffering したりretry してくれるのでアウトプット先への負荷コントロ ールなども容易 Output plugin in buffered mode
stores received events into buffers first and write out buffers to a destination by meeting flush conditions. 13 / 27
Plugins 新しいデータ⼊出⼒への対応を容易にする 14 / 27
1. Input Plugin 2. Output Plugin 3. Filter Plugin 4.
Parser Plugin 5. Formatter Plugin 6. Buffer Plugin 7. Storage Plugin 15 / 27
Input Plugin データソース⽤、ファイルを呼んだりlogger からforwarding されてきた りできる An input plugin typically
creates a thread socket and a listen socket. It can also be written to periodically pull data from data sources. 16 / 27
Parser Plugin インプットソースのデータ処理するやつ。filter との使い分けが重要。 cannot parse the user’s custom data
format (for example, a context- dependent grammar that can’t be parsed with a regular expression). 17 / 27
Filter Plugin label やtag に基づいてデータ整形するやついろいろできる 1. 削ったり 2. イベントの追加したり 3.
マスキングしたり 18 / 27
Output Plugin いろんな出⼒先に接続するやつ 19 / 27
Formatter Plugin Sometimes, the output format for an output plugin
does not meet one’s needs. 出⼒フォーマットを決定するやつ 20 / 27
Buffer Plugin memory やfile によるbuffering storage 21 / 27
Storage Plugin plugin による状態(接続先への転送量など)の統計情報を蓄積できたり 22 / 27
いろいろできる 23 / 27
もう少し内部を⾒ てみる 24 / 27
25 / 27
ここからは! abicky さんのblog で内部構造やdata lost について⾒ていく! https://abicky.net/2017/10/23/110103/ 26 / 27
ref Fluentd Blog - Unified Logging Layer: Turning Data into
Action fluentd - Buffer Plugin Overview あらびき⽇記 - fluentd の基礎知識 sonots:blog - fluentd でログが⽋損する可能性を考える 27 / 27