nxlog-ce-2.9.1716.msi をインストールします。
C:\Program Files (x86)\nxlog\conf\nxlog.conf を修正します。
## This is a sample configuration file. See the nxlog reference manual about the
## configuration options. It should be installed locally and is also available
## online at http://nxlog.org/docs/
## 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
<Extension _syslog>
Module xm_syslog
</Extension>
<Extension json>
Module xm_json
</Extension>
<Input in>
Module im_msvistalog
Exec if ($Message =~ /^@cee:(.*)/) { parse_json($1); }
Exec $Message = "@cee:" + to_json();
</Input>
<Output out>
Module om_tcp
Host 192.168.0.123 # rsyslogd
Port 514
Exec to_syslog_bsd();
</Output>
<Route 1>
Path in => out
</Route>
デフォルトでサービスは自動起動に設定されていますが、インストール直後は開始されていません。
テスト起動は c:\Program Files (x86)\nxlog>nxlog.exe -f が利用できます。
アプリケーション側から @cee: で記録されたログはパースされ Windows Event Log の属性とマージされて rsyslogd へ再び @cee: で構造化され送られます。
ReportEvent (ReportEventAも) で Windows Event Log に送られたデータは rsyslogd に出力される際は utf8 になるようです。
設定ファイルのサンプルはソースの doc/reference-manual/config-examples/config-example-* に多数ありました。
ソースもこちらから 入手 できます。
