首页 技术 正文
技术 2022年11月17日
0 收藏 432 点赞 3,540 浏览 1290 个字

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)\nxlogModuledir %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)\nxlogModuledir %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>
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,493
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,294