nxlog 日志采集

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\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>

 

转载于:https://www.cnblogs.com/sharesdk/p/7865896.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值