Your SlideShare is downloading. ×
Log collect with google fluentd
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Log collect with google fluentd

245
views

Published on

Google Cloud Platformでログを収集し、BigQueryにログを流し込みました

Google Cloud Platformでログを収集し、BigQueryにログを流し込みました

Published in: Internet

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
245
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • 本番稼働させるならば、json encodeしたデータをさらにmessageのvalueに入れる必要がある
  • 公式ページに制限が書いてないので、どれくらいログが保存されるかわからない…
  • fluent-plugin-bigqueryでもサポートされてた
    Tag毎にデータセットが変えられない点は不便
  • Transcript

    • 1. Log Collect with Google-fluentd
    • 2. 前置
    • 3. Purpose? 携帯端末(iOS/Android)の操作ログを収集 操作ログはjson形式 解析基盤は、Google Cloud Logging + Big Query を利用
    • 4. Why Big Query? SQL! json構造体に対してSQL発行 権限制御されたwebインターフェース ストリーミングインサート! ログバッファ容量にやさしい ストレージ価格が安い!(TB/月) Microsoft Azure Standard Storage / 約2,500円 Amazon S3 / 約3,300円 Amazon Redshift dw2.large(160GBytes SSD) / 22,600 円 Google BigQuery / 約2,000円
    • 5. sums it up クライアント httpでサーバーに対し、jsonデータをポスト サーバー Fluentdのin-httpでデータ受信 Google Cloud Loggingでログ確認 Google Big Queryでビッグデータ解析 Simple!!
    • 6. 全体像
    • 7. OVERVIEW Cloud Logging Big QuerySmart Phone HTTP Protocol json format fluent-plugin- google-cloud Streaming Insert in Compute Engine ② ① ③ ④
    • 8. ①-1.Google-fluentd Google Compute Engineで稼働するfluentd インストール方法はこちら https://cloud.google.com/logging/docs/install/com pute_install td-agent 2.1.2 相当? root@td-agent01:/etc/google-fluentd# /usr/sbin/google-fluentd -- version google-fluentd 0.10.57
    • 9. ①-2.Google-fluentd Setting 使用感はfluentdと変わらない configは/etc/google-fluentd/google-fluentd.conf root@td-agent01:/etc/google-fluentd# ls -al /etc/google-fluentd/ total 78236 drwxr-x--- 5 root root 4096 Dec 2 21:25 . drwxr-xr-x 94 root root 4096 Feb 16 06:44 .. drwxr-x--- 2 root root 4096 Dec 2 21:19 catch-all-inputs.d -rw-r--r-- 1 root root 80071266 Feb 16 06:18 google-fluentd_1.1.1-0_amd64.deb -rw-r----- 1 root root 1021 Dec 1 22:53 google-fluentd.conf -rw-r----- 1 root root 11324 Nov 19 23:56 LICENSE drwxr-xr-x 2 root root 4096 Feb 16 06:18 pkg drwxr-xr-x 2 root root 4096 Feb 16 06:19 plugin -rw-r----- 1 root root 249 Nov 20 18:25 README.md 起動停止はserviceコマンドで root@td-agent01:/etc/google-fluentd# service google-fluentd restart * Restarting google-fluentd google-fluentd
    • 10. ①-3.Google-fluentd Custom in_HTTPプラグインを起動させてみる TCP Port:8888でサーバーが起動 root@td-agent01:/etc/google-fluentd# cat << EOF > /etc/google- fluentd/catch-all-inputs.d/in_http.conf <source> type http port 8888 bind 0.0.0.0 body_size_limit 32m keepalive_timeout 10s </source> EOF root@td-agent01:/etc/google-fluentd# service google-fluentd restart * Restarting google-fluentd google-fluentd
    • 11. ②.Client HTTP通信でjsonを投げ込む $ curl -X POST -d 'json={"message":"test_message3"}' http://***.***.***.***:8888/test Keyが「message」の部分のみ取り込まれる 理想:(できない) curl -X POST -d ‘json={“action”:“login”,“user”:2}’ http://***.***.***.***:8888/test 現実:(messageだけ入る) curl -X POST -d 'json={"message":"test_message2","id":"001"}' http://***.***.***.***:8888/test
    • 12. ③-1.Google Cloud Logging? Google App Engine & Google Cloud Engineでの ログを確認するツール 無料 GUIでの簡単な検索機能 Fluentタグでの絞り込み BigQuery & Cloud Storageへの連携機能 2015年2月現在αリリース
    • 13. ③-2.Cloud Logging Interface
    • 14. ③-3.Cloud Logging Interface Search Log Data Fluentd tag
    • 15. ③-4.How to Send BigQuery? Very Simple!!
    • 16. ④. Confirm BigQuery 完了!!
    • 17. 所感
    • 18. Impression Cloud Logging ⇒ BigQuery連携は、テーブルが 存在しない場合は自動作成される Fluentdのtagでフィルタできるので便利 既存の知識が使えるので、難易度は低い