Fluentd UIãåºãã®ã§è§¦ã£ã¦ã¿ã
fluent/fluentd-ui https://github.com/fluent/fluentd-ui
Fluentdç¨ã®Web UIãåºãããã§ãã試ãã«è§¦ã£ã¦ã¿ã¾ãã
ã¤ã³ã¹ãã¼ã«
READMEã®ã¨ããã§ããã
$ gem install fluentd-ui $ fluentd-ui start Open http://localhost:9292/ by your browser default account is username="admin" and password="changeme"
ãããã¯ã
$ git clone https://github.com/treasure-data/fluentd-ui
$ cd fluentd-ui
$ bundle install
$ bundle exec rails s
ã§ãã
åã¯bundlerã§ããããã¨ã«ãã¾ããã
-> % bundle exec rails s => Booting Puma => Rails 4.1.4 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option) => Ctrl-C to shutdown server Puma 2.8.2 starting... * Min threads: 0, max threads: 16 * Environment: development * Listening on tcp://0.0.0.0:3000
èµ·åããã¨ãã°ã¤ã³ç»é¢ãåºã¦ãã¾ããããã©ã«ãè¨å®ã¯username: admin, password: changeme ã§ãã

ãã°ã¤ã³ããã¨ãããªæãã§ç«ã¡ä¸ããã¾ãã

æ©é触ã£ã¦ã¿ã¾ããã¾ãã¯fluentdãã¤ã³ã¹ãã¼ã«ãã¾ãã

ã¤ã³ã¹ãã¼ã«ããã¾ããããç¶ãã¦è¨å®ããã¦ããã¾ãããããªæãã«ä»Fluentdãã©ããããã¼ã¿ãèªã¿åããã©ãã«åºåãããã¨ãã¦ããã®ãããããããã表示ããã¦ã¾ãã

ã§ã¯å®éã«ãã¡ã¤ã«ã®å ¥åã«ã¤ãã¦ç·¨éãã¦ããã¾ããå ¥åã®ããã¡ã¤ã«ããã¯ãªãã¯ããã¨ãã©ããããã¡ã¤ã«ãèªã¿åããã鏿ããç»é¢ãåºã¦ãã¾ãã

ããã§ã¯ /var/log/system.log ãèªã¿åããã¨ã«ãã¾ããããããªæãã§ãã°ãpreviewãããã¨ãã§ãã¾ãã

次ã«ãã¡ã¤ã«ãèªã¿åãéã®è¨å®ããã¾ããããã§ã¯ããã©ããªãã©ã¼ãããã¨ãã¦ãã°ãèªã¿åãããã¨ããè¨å®ããããã¨ãã§ãã¾ãããã®ç»é¢ã¯ããããããã¦ä¾¿å©ã§ãããä»åã¯syslogå½¢å¼ãªã®ã§ãformatãsyslogã«ãã¦ãã¾ãã

ããã§ç¡äºè¨å®ã夿´ããã¾ãããçæãããè¨å®ã¯ä»¥ä¸ã®ã¨ããã§ãã
<source> # http://docs.fluentd.org/articles/in_forward type forward port 24224 </source> <source> # http://docs.fluentd.org/articles/in_http type http port 9880 </source> <source> type monitor_agent port 24220 </source> <source> type debug_agent port 24230 </source> <match debug.*> # http://docs.fluentd.org/articles/out_stdout type stdout </match> <source> type tail path /var/log/system.log tag syslog.test format syslog time_format %b %d %H:%M:%S pos_file /tmp/fluentd--1406888587.pos </source>
æ´æ°ããã¨fluentdãåèµ·åããã¦è¨å®ãreloadããã¾ããfluentdèªä½ã®èµ·ålogãã¿ã¦ã¿ã¾ãããã

ã¡ããã¨tailããã¦ããããã§ãã試ãã«MongoDBã«ããã¦ã¿ã¾ããããã©ã«ãã§ã¯ãã©ã°ã¤ã³ã¯å ¥ã£ã¦ããªãã®ã§ãããã¦ã¿ã¾ãããããFluentd UIä¸ããè¡ããã¨ãã§ãã¾ããMongoDBç¨ã®ãã©ã°ã¤ã³ãããã¦ã¿ã¾ããããã¤ã³ã¹ãã¼ã«ãã¿ã³ãæ¼ãã°è¨å®ã§ãã¾ãã

ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®ãã©ã°ã¤ã³ã¯ãããªæãã§é²è¦§ã§ãã¾ãã

è¨å®ã追å ãã¦ã¿ã¾ããmongoã®è¨å®ã¯ç»é¢ããè¡ããã¨ãã§ãã¾ãããã½ã¼ã¹ã¨åºåå ã®è¨å®ãã®ç»é¢ãããMongoDBããã¯ãªãã¯ããã¨ãããªæãã§è¨å®ç»é¢ãéãã¾ãã

è¨å®ã¯çµæçã«ãããªæãã«ãªãã¾ããã
<match syslog.test> type mongo host 127.0.0.1 port 27017 database fluentd collection test capped capped_size 100m </match>
è¨å®ã追å ããã¨åæã«fluentdãreloadããã¾ããmongoå´ãã¿ã¦ã¿ã¾ãããã*1
-> % all output going to: /usr/local/var/log/mongodb/mongo.log
mongo
MongoDB shell version: 2.4.8
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
Fri Aug 1 19:49:01.275 [initandlisten]
Fri Aug 1 19:49:01.275 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
> show dbs;
fluentd 0.140625GB
fluentdã®dbãã§ãã¦ã¾ãããqueryãã¦ã¿ã¾ãã
# 以ä¸mongo shell
> use fluentd;
switched to db fluentd
> db.test.find()
{ "_id" : ObjectId("53db72001df33a7e96000001"), "host" : "xxx", "ident" : "SystemUIServer", "pid" : "425", "message" : "Impossible to find range of h or H in date format.", "time" : ISODate("2014-08-01T10:54:34Z") }
{ "_id" : ObjectId("53db723d1df33a7e96000002"), "host" : "xxx", "ident" : "SystemUIServer", "pid" : "425", "message" : "Impossible to find range of h or H in date format.", "time" : ISODate("2014-08-01T10:55:34Z") }
{ "_id" : ObjectId("53db727a1df33a7e96000003"), "host" : "xxx", "ident" : "SystemUIServer", "pid" : "425", "message" : "Impossible to find range of h or H in date format.", "time" : ISODate("2014-08-01T10:56:34Z") }
ã¡ããã¨ã¯ãã£ã¦ã¾ããã*2
ææ
- ããã£ã¨ãã¼ã«ã«ã«fluentdã®ç°å¢ä½ã£ã¦ãããããã©ã°ã¤ã³å
¥ããããã°ã試ãã«ããã¦ã¿ãããã¨ããã¨ãã«ããã£ã¨ã§ãã¦è¯ã
- fluentdæ¬ä½ã®ã¤ã³ã¹ãã¼ã«ãfluentdã®ãã©ã°ã¤ã³ãç°¡åã«å ¥ãããã¨ãã§ãã
- ã¢ããªã±ã¼ã·ã§ã³ãã°ãã¤ããã®ã¯æéããããããã©ã
- in_tailã®UIã便å©
- ã©ããªãã°ãèªããã¨ãã¦ãããããã¬ãã¥ã¼ãã¤ã¤ãtailã®è¨å®ãæ¸ããã¨ãã§ãã
- å®éã«ã©ããªé¢¨ã«ãã°ãèªã¿åãããããè¦ã¤ã¤ãè¨å®ã調æ´ãããã¨ãã§ãããç´ æµã
- http://fluentular.herokuapp.com/ ã§è©¦ãããããªãã¨ãFluentd UIã®ä¸ã§ã§ãã¾ãã
- ã©ããªãã°ãèªããã¨ãã¦ãããããã¬ãã¥ã¼ãã¤ã¤ãtailã®è¨å®ãæ¸ããã¨ãã§ãã
- pluginããã¾ãå
¥ããªãã£ã
- ãã®ã«ãããfluentd-plugin-elasticsearchãå ¥ããªãã£ããä¾ågemããã¾ããã£ã¦ããã¦ãªãã®ãããããªãã
Fluentdã触ã£ããã¨ããªãã¨ããå ´åã§ãããã£ããã»ããã¢ããã¨è¨å®ãè¡ããã¨ãã§ããã®ã§ã¯ãªããæãã¾ãããã¼ã«ã«ã§ããã£ã¨è©¦ãç¨éã«ãããã®ã§ã¯ãªãã§ãããããã¾ã versionã0.10ã§ãã®ã§ãä»å¾ä½¿ãããããªã£ã¦ããã®ã楽ãã¿ã§ãã