implyを用いたアクセスログの可
視化
@gepuro
動機
strata + hadoopでイケてる分析基盤を知って、自分でも作りたくなった。
アクセス状況をリアルタイムに収集加工して、サイトに反映させたい。
(google analyticsは課金しないと生ログを取れない・・・orz)
2/14
完成予定
3/14
blog
web_beacon
article
kafka
spark_streaming
S3
druid
twitter
kafka_manager
pivot
flask
API
今回の話(druidからpivotの部分)
4/14
blog
web_beacon
article
kafka
spark_streaming
S3
druid
twitter
kafka_manager
pivot
flask
API
druid
ストリーミングデータに特化したデータベース
アドテクで利用されていて、秒間100万イベントを処理できる。(yahoo inc)
時系列やtopN(ランキングの上位)を求めるのが得意
·
·
·
5/14
pivot
タブローライクな分析ツール
http://imply.io/ が開発している。
https://github.com/implydata/pivot
·
·
·
6/14
データ例
{
"time": "2015-10-28T22:58:03Z",
"sid": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"cid": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"site": "hoge.com",
"url": "http://hoge.com/lp/1",
"referrer": "https://www.google.co.jp/",
"ip": "123.123.123.123",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2
}
7/14
設定ファイル(1/5)
{
"type" : "index_hadoop",
"spec" : {
"ioConfig" : {
"type" : "hadoop",
"inputSpec" : {
"type" : "static",
"paths" : "/data/example"
}
},
8/14
設定ファイル(2/5)
"dataSchema" : {
"dataSource" : "webbeacon",
"granularitySpec" : {
"type" : "uniform",
"segmentGranularity" : "day",
"queryGranularity" : "none",
"intervals" : ["2015-10-28/2015-10-29"]
},
9/14
設定ファイル(3/5)
"parser" : {
"type" : "string",
"parseSpec" : {
"format" : "json",
"dimensionsSpec" : {
"dimensions" : [
"time",
"sid",
"cid",
"site",
"url",
"referrer",
"ip",
"user-agent"
]
},
10/14
設定ファイル(4/5)
"timestampSpec" : {
"format" : "auto",
"column" : "time"
}
}
},
11/14
設定ファイル(5/5)
"metricsSpec" : [
{"name": "views", "type": "count"}
]
},
"tuningConfig" : {
"type" : "hadoop",
"partitionsSpec" : {
"type" : "hashed",
"targetPartitionSize" : 5000000
},
"jobProperties" : {}
}
}
}
12/14
デモ
http://imply.gepuro.net/
13/14
最後に
druidもpivotの圧倒的に情報が少ない・・・(Sparkよりも無い)。 でも、優れたミ
ドルウェアな予感がする。
14/14

implyを用いたアクセスログの可視化