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
Design Patterns for Collecting and Analyzing Sc...
Search
Sotaro Karasawa
August 09, 2013
Technology
5
800
Design Patterns for Collecting and Analyzing Schemaless Log
スキーマレスなログデータの収集と集計のためのデザインパターン
at
http://www.zusaar.com/event/876003
Sotaro Karasawa
August 09, 2013
Tweet
Share
More Decks by Sotaro Karasawa
See All by Sotaro Karasawa
P2B Haus法人サポータープランのご提案
sotarok
0
4
ソフトウェアxスタートアップから見た飲食と配送の世界 / The World of Food Deliverlies and Restaurant Businesses from a Software and Startup Perspective
sotarok
2
1.2k
CTO 3度目の正直 / My 3rd CTO Career
sotarok
21
10k
Introduction to the Corporate Solutions Engineering at MTC2018
sotarok
1
36k
Mercari meetup for Corporate Engineering #1 / What is "Corporate Engineering"?
sotarok
2
2.3k
Markdown and WYSIWYG
sotarok
1
5.9k
20 Jan 2017 / Moving Beyond Borders - Mercari DAY
sotarok
8
15k
PHPBLT の心得 / PHPBLT #5 @ペパボ
sotarok
5
3.4k
Wiki についての今昔物語 / Crowi
sotarok
5
14k
Other Decks in Technology
See All in Technology
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
280
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
12
3.4k
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
120
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
160
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
540
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
370
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
100
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
2
250
生成AIをより賢く エンジニアのための RAG入門 - Oracle AI Jam Session #20
kutsushitaneko
4
210
Featured
See All Featured
Building Adaptive Systems
keathley
38
2.3k
Making Projects Easy
brettharned
116
5.9k
A Philosophy of Restraint
colly
203
16k
Practical Orchestrator
shlominoach
186
10k
KATA
mclloyd
29
14k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Adopting Sorbet at Scale
ufuk
73
9.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Code Review Best Practice
trishagee
65
17k
Designing Experiences People Love
moore
138
23k
How STYLIGHT went responsive
nonsquared
95
5.2k
What's in a price? How to price your products and services
michaelherold
243
12k
Transcript
Crocos, Inc. Sotaro Karasawa @sotarok http://facebook.com/sotarok εΩʔϚϨεͳ ϩάσʔλͷ ऩूͱूܭͷͨΊͷ σβΠϯύλʔϯ
#ds2013 ·ͨ Treasure Data ϋΠύʔ׆༻ज़
ࣗݾհ 4PUBSP,BSBTBXB!TPUBSPL ฑ૱ଠ EIBUFOBOFKQTPUBSPL גࣜձࣾΫϩίε$SPDPT*OD 1)1 3FE#VMM
ࣾһਓͰۀ ։ൃऀ࣌ਓ ݄ʹαʔϏεϩʔϯν ݄ʹ5%ಋೖ
ࠓ͍ͨ͜͠ͱ ΞϓϦέʔγϣϯϩάΛͲ͏ू ΊΔ͔ εΩʔϚϨεͳϩάͱ جຊతͳϩάઃܭ ϩάऩूͷσβΠϯύλʔϯ
ࠓͷత ใڞ༗ɺใަ ͏ͪͰ͜͏ͬͯΔΑɺͱ͍͏Ұྫ ܾͯ͠ߨࢣͱͯ͠ɺ͜͏Γ·͠ΐ͏ͱݴ ͍ʹདྷͨΘ͚Ͱͳ͘ɻ ࠓޙɺ͜͏͍͏ωλ͕σΟεΧογϣϯͰ ͖Ε͍͍ͳͱ
ओʹ 8FCΞϓϦέʔγϣϯ ͷ Ͱ͕͢ɺ8FCΞϓϦέʔγϣϯଟ༷Խ͠ ͍ͯ·͢ ޙͷσβΠϯύλʔϯͷͳ͔Ͱ͍͔ͭ͘ ৮ΕΒΕΔ͔ͳʁ
2ϩάऩूΛ͍ͯ͠Δ 2qVFOUEΛ͍ͬͯΔ 25%Λ͍ͬͯΔ
ͲΜͳϩάΛूΊͯΔʁ
8FCαʔόͷϩά
ϩάͱ͍͑ 8FCαʔόʔͷϩά 5SFBTVSF%BUBͷνϡʔτϦ Ξϧ"QBDIFͷϩά http://docs.treasure-data.com/articles/quickstart
͚ͩͲຊʹཉ͍͠ͷ
ͲΜͳϢʔβʔ͕ʁ ͲΜͳͰʁͲ͔͜Βʁ ͍ͭԿΛͨ͠ͷ͔ʁ ͲΜͳϘλϯΛΫϦοΫͨ͠ ͷ͔ʁλοϓͨ͠ͷ͔ʁ
ΞϓϦέʔγϣϯϩά
ͲΜͳϢʔβʔ͕ʁ ɹˠϢʔβʔొใ ͲΜͳͰʁͲ͔͜Βʁ ɹˠ6"(&0 ͍ͭԿΛͨ͠ͷ͔ʁ ɹˠ63*ΞΫγϣϯ
ΞϓϦέʔγϣϯϩάΛ Ͳ͏ूΊΔ͔
εΩʔϚϨεϩάͱʁ
εΩʔϚϨεϩάͱʁ εΩʔϚͷແ͍ϩά
ϩάͷεΩʔϚ ͜Ε·Ͱ ˠྫ͑547
ΧϥϜUJNF ΧϥϜTUBUVT ΧϥϜVSJ ΧϥϜVTFS@JE JOEFY
ΧϥϜUJNF ΧϥϜTUBUVT ΧϥϜVSJ ΧϥϜVTFS@JE JOEFY εΩʔϚ
for line in open('app.log', 'r'): columns = line.split("\t") time =
columns[0] ...
߲ͷΘ͔ΓͮΒ͞ εΩʔϚมߋͷ͠͞ ੳऀͱऩूऀͷೝࣝࠩҟʹ ΑΔࣄނ
5%ͷϩά ͱ͍͏͔qVFOUE +40/ { "time":1373876885, "status":200, "request_uri":"/52495/facebook", "session_id":"kn6avn2fuh21r25a65mgm3rjh3", "fb_id":"7c40c5dd2e55cde37a8c40ed80e1", ...
}
Θ͔Γ͍͢ ߲ΛՃͰ͖Δ σʔλྔ૿͑Δɾ
ΞϓϦέʔγϣϯϩάΛ Ͳ͏ूΊΔ͔
جຊతͳϩάઃܭ
ΠϕϯτϨίʔυͱͳΔΑ ͏ʹه͢Δ ˞8FCΞϓϦέʔγϣϯͷ߹ɺΞΫηε
Πϕϯτͱ 8FCΞϓϦέʔγϣϯͳΒ ɾΞΫηε ωΠςΟϒΞϓϦͳΒ ɾΠϕϯτ
جຊతͳεΩʔϚΛܾΊΔ
εΩʔϚϨεͱ͍ͬͯ Ͳ͏͍͏ϩάΛѻ͍ͬͯΔͷ͔ ֤ϨίʔυͰҙຯ͕ҧͬͯҙ ຯ͕ແ͍
جຊతͳεΩʔϚΛܾΊΔ UJNF TUBUVT VSJ VB SFGFSSFS
جຊతͳεΩʔϚΛܾΊΔ UJNF TUBUVT VSJ VB SFGFSSFS LTSVͬΆ໊͍લʹ ߹Θ͓ͤͯ͘ͱΘ ͔Γ͍͔͢
8FCαʔόʹ͋Δϩά ͚ͩͰͳ͘ BQQ SPVUF DPOUSPMMFS QSPDFTT@UJNF EFWJDF
8FCαʔόʹ͋Δϩά ͚ͩͰͳ͘ BQQ SPVUF DPOUSPMMFS QSPDFTT@UJNF EFWJDF ϑϨʔϜϫʔΫͰͷϧʔ ςΟϯά໊ͱ͔ɺίϯτ
ϩʔϥ໊ͱ͔ (uri ʹϊΠζ͕͋ͬͯ routing ໊ͰूܭͰ͖Δ)
ΞϓϦέʔγϣϯͷΓ͏Δ ଐੑΛඇਖ਼نԽͯ͠Ϩίʔυ ʹؚΊΔ
ඇਖ਼نԽ͞ΕͨϨίʔυ TFTTJPO@JE VTFS@JE HFOEFS BHF EFWJDF
ͳͥඇਖ਼نԽ͔ͷϝϦοτ +0*/ͤͣʹूܭؔʹ͔ΔͨΊ
ͪͳΈʹ VTFS@JE TFTTJPO@JE ͳͲIBTIԽ͓ͯ͘͠
·ͱΊΔͱ ΠϕϯτϨίʔυͱͳΔΑ͏ ʹه͢Δूܭؔʹ͔ΔͨΊ جຊతͳεΩʔϚΛܾΊΔ ΞϓϦέʔγϣϯͷΓ͏Δଐ ੑΛඇਖ਼نԽͯ͠ϨίʔυʹؚΊΔ
͜͜·ͰདྷΔͱɺ͏ੳ͕Մೳ
ੳͷྫ SELECT AVG(v[‘process_time’]) FROM access WHERE v[‘route’] = ‘crocos_index’
ੳͷྫ SELECT v[‘gender’], COUNT(*) FROM access GROUP BY v[‘gender’] ඇਖ਼نԽ͓͍ͯ͠
ͯΑ͔ͬͨʂ
ੳͷྫ SELECT v[‘gender’], COUNT(*) FROM access GROUP BY v[‘gender’]
ੳͷྫ Τϥʔͷௐࠪʹ SELECT v[‘route’], v[‘status’], v[‘ua’] FROM access WHERE v[‘user_id’]
= ‘xxx’
˞͘ͳΔͷͰؔ࿈ͷॲཧলུͯ͠·͢ ɹຊผʹ(3061#:ͨ͠Γ8&)&3۟ͰߜͬͨΓ
εΩʔϚϨεͳ ΞϓϦέʔγϣϯϩά ͷͨΊͷ σβΠϯύλʔϯ Λߟ͑Δ
ͯ͞ جຊతͳεΩʔϚΛ࣋ͭ ϩά͕ͨ·Γ࢝Ί·ͨ͠
͔͜͜Βઌ ԿΛੳΛ͍ͨ͠߹ʹ ͲΜͳϩάΛೖΕ͓͚ͯྑ ͍͔ ύλʔϯʹ͚ͯߟ͑·͢
εΩʔϚϨεͷग़൪
جຊతͳεΩʔϚ UJNF TUBUVT VSJ VB SFGFSSFS ͳΜͪΌΒ ͔ΜͪΌΒ
جຊతͳεΩʔϚ UJNF TUBUVT VSJ VB SFGFSSFS ͳΜͪΌΒ ͔ΜͪΌΒ ಛఆͷϨίʔυʹɺಛ
ผͳҙຯΛͨͤΔ͜ͱ ͕Ͱ͖Δʂ ͔͠ଞͷϨίʔυʹӨ ڹΛ͋ͨ͑Δ͜ͱͳ͘ɻ
ύλʔϯ τϥϯβΫγϣϯ
ಛผͳҙຯΛ࣋ͭ ΞΫγϣϯͷޭͳͲΛ ه͍ͨ͠
τϥϯβΫγϣϯ uri route: ϦΫΤετ͕དྷͨ͜ͱΘ͔Δ ͔͠͠ɺຊʹޭ͔ͨ͠ɺ ΞϓϦέʔγϣϯͰ͔͠Θ͔Β ͳ͍
τϥϯβΫγϣϯ key_action key_attr_*
τϥϯβΫγϣϯ key_action present:entry:completed ΞϓϦ:ಈ࡞:ঢ়گ ※͜ͷྫʮొྃʯ
τϥϯβΫγϣϯ key_attr_* τϥϯβΫγϣϯʹؔΘΔՃ తͳใΛͭͬ͜Ή εΩʔϚɺkey_action ͝ͱʹ ҟͳΔ
τϥϯβΫγϣϯྫ key_action = shop:register:completed key_attr_user_id = xxxxx key_attr_ref = fb_share
τϥϯβΫγϣϯੳͷྫ SELECT v[‘key_attr_ref’], COUNT(*) FROM access WHERE v[‘key_action’] = ‘...’
GROUP BY v[‘key_attr_ref’]
τϥϯβΫγϣϯੳ ࠷ۙΑ͘ݟͯΔσʔλ ... Ͳͷࢪࡦ͕Ұ൪ޮ͍ͨͷ͔
ύλʔϯ Πϕϯτ
ΞΫηεʹґଘ͠ͳ͍ ΠϕϯτͷൃੜΛΓ͍ͨ
ɾ+BWB4DSJQUʹΑΔΠϕϯτ ɾϞʔμϧͷදࣔ ɾ5XJUUFS'BDFCPPLͷ γΣΞ ɾωΠςΟϒΞϓϦ
Πϕϯτ tag = app:action:location & some attributes
Πϕϯτྫ tag = shop:tweet:shop_item item_id = 1234 tweet_id = xxxxx
Πϕϯτੳͷྫ SELECT v[‘item_id’], COUNT(*) FROM events WHERE v[‘tag’] = ‘shop:tweet:shop_item’
GROUP BY v[‘item_id’]
τϥϯβΫγϣϯͱ ࣮Έ͔ΘΒͳ͍
εΩʔϚϨεϩάͷѻ͍ํͰ ࠷ॏཁͳͷ ղऍͷϧʔϧΛܾΊΔ͜ͱ
ଟ͕࣌ؒແ͍ͷͰ ͜ͷΜͰ
͜͏͍͏࣌ʹ ͜͏͍͏෩ʹσʔλͷूΊͯ ͜͏ղੳ͠Α͏ ͱ͍͏ͷΛڞ༗͍ͨ͠
ҙ͍ͨ͠ͱ͜Ζ
εΩʔϚϨεͱ͍͑Ͳ ࣄલͷϩάઃܭΛ͔ͬ͠ΓΔ ϩάҰೖΕΔͱมߋ͕͍͠ ˠੳ͍߲ͨ͠ͷ࿙Ε͕ແ͍͔ ϓϥΠόγʔʹؾΛ͚ͭΔ
None