Contenu connexe
Similaire à Fluentd勉強会 (導入編 TreasureData活用) (20)
Fluentd勉強会 (導入編 TreasureData活用)
- 17. TreasureDataの操作
DB作成
$ td db:create データベース名
$ td table:create データベース名テーブル名
データ投入
$ td sample:apache apache.json
$ td table:import データベース名 テーブル名--json apache.json
tail -n 1 apache.json {"host":"200.129.205.208","user":"","method":"GET","path”:"/category/electronics”,"code":200,"refe
rer":"-","size":62, "agent":"Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56
Safari/535.11","time":1334035906}
- 24. apacheのログ送信
td-agent.conf
<match td.*.*>
type tdlog
apikey XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
auto_create_table
buffer_type file
buffer_path /var/log/td-agent/buffer/td
use_ssl true
</match>
<source>
type tail
path /var/log/httpd/httpd.access_log
pos_file /tmp/httpd.access.log.pos
format apache
tag td.test.httpd
</source>
- 25. 自由形式のログを送信
こんなアクセスログがあったとする。
アクセスログ
2013-10-22 07:46:37,028 1270859 2013-10-17
2013-10-22 09:03:46,635 1197675 2013-10-19
2013-10-22 12:32:25,593 1189472 2013-10-22
2013-10-22 12:33:05,671 1271888 2013-10-22
2013-10-22 12:38:21,005 1272255 2013-10-22
2013-10-22 12:41:40,961 1021213 2013-10-22
2013-10-22 12:43:46,654 1271174 2013-10-19
2013-10-22 12:44:43,604 1077677 2013-10-22
2013-10-22 12:45:38,035 1272280 2013-10-22
2013-10-22 12:47:23,007 1080238 2013-10-22
2013-10-22 12:47:38,265 1271174 2013-10-19