背景
本地使用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