使用nxlog收集windows服务器dns日志

背景

本地使用windows server 2016搭建的dns服务器,现在需求把dns日志传到日志收集平台做汇总分析

步骤

1.搭建dns服务器,及配置日志。dns服务器搭建过程省略,配置本地存储日志如图所示:按需开启调试日志,文件路径要写好,后面会用。

2.测试日志是否在本地产生

3.安装nxlog

windows 下安装nxlog,配置文件在nxlog/conf/nxlog.conf.

启动过程中,日志在nxlog/data/nxlog.log .这个在排查我们写的conf对不对很重要。

4.配置nxlog

nxlog配置分为输入(Input)、输出(Output)、路径(Route);输入为需要采集的数据源;输出为日志需要发送的目的地,比如文件、数据库、日志服务器;路径为关联输入输出的规则。

Most log processing solutions are built around the same concept. The input is read from a source, log messages are processed, and then log data is written to a destination. In NXLog, this path is called a "route" and is configured with a Route block.
Routes are made up of one or more inputs, zero or more processors, and one or more outputs.

详细可以查看nxlog的用户手册。

本次的配置如下:

5.结果

wirshark抓包 udp.port == 514

用户手册:https://nxlog.co/documentation/nxlog-user-guide.pdf

原文地址:https://www.cnblogs.com/hnsya/p/14393364.html