1. 程式人生 > >nxlog 日誌采集

nxlog 日誌采集

products 接口 pat 環境 epo style linu art fin

主要用於各業務後端服務的日誌采集,windows環境和linux環境都支持。

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為日誌采集接口地址

配置示例:

nglog.conf

## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
 
 
#define ROOT C:\Program Files\nxlog define ROOT C:\Program Files (x86)\nxlog Moduledir %ROOT%\modules CacheDir %ROOT%\data Pidfile %ROOT%\data\nxlog.pid SpoolDir %ROOT%\data LogFile %ROOT%\data\nxlog.log <Input in> Module im_file File ‘./*.log
  // 日誌目錄
    SavePos     True
</Input> <Output out> Module om_http ContentType application/x-www-form-urlencoded URL http://  
  // 日誌采集接口地址
</Output> <Route httpout> Path in => out </Route>

多級目錄配置:

所有日誌在多個文件夾
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
 
 
#define ROOT C:\Program Files\nxlog define ROOT C:\Program Files (x86)\nxlog Moduledir %ROOT%\modules CacheDir %ROOT%\data Pidfile %ROOT%\data\nxlog.pid SpoolDir %ROOT%\data LogFile %ROOT%\data\nxlog.log # 1 <Input in1> Module im_file File ./1/*.log SavePos True </Input>
# 2 <Input in2> Module im_file File ‘./2/*.log SavePos True </Input> <Output out> Module om_http ContentType application/x-www-form-urlencoded URL http://127.0.0.1/xx </Output> <Route httpout> Path in1,int2 => out </Route>

nxlog 日誌采集