Apache Logs Integration with DNIF on Windows
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Apache Logs Integration with DNIF on Windows

  • Dark
    Light
  • PDF

Configure NXLog to send Apache logs to DNIF.

If you want to integrate Apache Tomcat access logs as well as Windows event logs, please refer our help guide: Integrating Windows Event Logs.

Download and Install Nxlog

  • Download and install the latest version of NXLog (Download Link) on the Windows machine from where the logs should be collected.

  • Once installation is completed, locate the nxlog.conf file in the C:\Program Files (x86)\nxlog\conf folder.

For** 32 bitWindows** machines, look in the C:\Program Files\nxlog\conf folder.

image.png

  • Open the nxlog.conf file using a text editor. Replace the entire configuration by copy-pasting the text given for your Windows version.

Windows x32 bit OS

#============ Define ROOT here ===================
define ROOT C:\Program Files\nxlog
#define ROOT C:\Program Files (x86)\nxlog
#============ NXLog Machine Log info =============
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log

#####for apache access log################

<Extension syslog>
Module xm_syslog
</Extension>

<Input apache-access-logs>
Module im_file
File 'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/xyzaccess.log'  ##path of log file
SavePos True
Recursive TRUE
PollInterval 1
Exec $Message=$raw_event;$SyslogFacilityValue=24;
</Input>

<Input apache-error-logs>
Module im_file
File 'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/xyzerrors.log'  ##path of log file
SavePos True
Recursive TRUE
PollInterval 1
Exec $Message=$raw_event;$SyslogFacilityValue=24;
</Input>

<Output out-apache>
Module om_udp
Exec to_syslog_bsd();
Host DNIF-Adapter-IP
Port 514
</Output>

<Route 1>
Path apache-access-logs, apache-error-logs => out-apache
</Route>

Windows x64 bit OS

#============ Define ROOT here ===================
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
#============ NXLog Machine Log info =============
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log

#####for apache access log################

<Extension syslog>
Module xm_syslog
</Extension>

<Input apache-access-logs>
Module im_file
File 'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/xyzaccess.log'  ##path of log file
SavePos True
Recursive TRUE
PollInterval 1
Exec $Message=$raw_event;$SyslogFacilityValue=24;
</Input>

<Input apache-error-logs>
Module im_file
File 'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/xyzerrors.log'  ##path of log file
SavePos True
Recursive TRUE
PollInterval 1
Exec $Message=$raw_event;$SyslogFacilityValue=24;
</Input>

<Output out-apache>
Module om_udp
Exec to_syslog_bsd();
Host DNIF-Adapter-IP
Port 514
</Output>

<Route 1>
Path apache-access-logs, apache-error-logs => out-apache
</Route>

Restart NXLog

  • To apply changes made on nxlog.conf, restart the service again.

  • Go to Control Panel > Services and locate the nxlogservice, right click nxlog and click Restart

image.png

Apache access and error logs are streamed to DNIF.


Was this article helpful?

What's Next