apache日志输出到mongod

最后更新于:2022-04-02 03:02:23

[TOC] ## 教程 1. 修改 td-agent.conf ``` @type tail path /var/log/apache2/access_log pos_file /var/log/td-agent/apache2.access_log.pos @type apache2 tag mongo.apache.access # plugin type @type mongo # mongodb db + collection database apache collection access # mongodb host + port host localhost port 27017 # interval flush_interval 10s # make sure to include the time key time_key time ``` 2. 测试 ``` ab -n 100 -c 10 http://localhost/ ```
';