Nxlog 主要用于各业务后端服务的日志采集,windows环境和linux环境都支持。
RPM 包: rpm -ivh http://nxlog.co/system/files/products/files/1/nxlog-ce-2.9.1716-1_rhel6.x86_64.rpm检测:rpm -qa |grep nxlog
nglog 主要分两部分:
Input In 部分:File参数对应的值为日志文件完整目录地址Output out部分:URL为日志采集接口地址
配置示例:
# cat nglog.conf ( windows 和 Linux 可通用 需注意编码格式问题 )
# cat nglog.conf ## Please set the ROOT to the folder your nxlog was installed into,## otherwise it will not start. #define ROOT C:\Program Files\nxlogdefine ROOT C:\Program Files (x86)\nxlog Moduledir %ROOT%\modulesCacheDir %ROOT%\dataPidfile %ROOT%\data\nxlog.pidSpoolDir %ROOT%\dataLogFile %ROOT%\data\nxlog.log Module im_file File './*.log' // 日志目录
SavePos TruePath in => out
多级目录的配置:
所有日志在多个文件夹## Please set the ROOT to the folder your nxlog was installed into,## otherwise it will not start. #define ROOT C:\Program Files\nxlogdefine ROOT C:\Program Files (x86)\nxlog Moduledir %ROOT%\modulesCacheDir %ROOT%\dataPidfile %ROOT%\data\nxlog.pidSpoolDir %ROOT%\dataLogFile %ROOT%\data\nxlog.log # 1 Module im_file File './1/*.log' SavePos True # 2 Module im_file File './2/*.log' SavePos TruePath in1,int2 => out