Hi, I’m having trouble sending the IIS logs to the Graylog server.
I have been able to send the windows logs correctly, but the IIS logs seem to not come out of the server.
I am attaching the nxlog.conf file and an excerpt from the nxlog.log to see if they can help me.
nxlog.conf:
Panic Soft
#NoFreeOnExit TRUE
define ROOT C:\Program Files (x86)\nxlog
define CERTDIR %ROOT%\cert
define CONFDIR %ROOT%\conf
define LOGDIR %ROOT%\data
define LOGFILE %LOGDIR%\nxlog.log
LogFile %LOGFILE%
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
# Check the size of our log file hourly, rotate if larger than 5MB
<Schedule>
Every 1 hour
Exec if (file_exists('%LOGFILE%') and \
(file_size('%LOGFILE%') >= 5M)) \
file_cycle('%LOGFILE%', 8);
</Schedule>
# Rotate our log file every week on Sunday at midnight
<Schedule>
When @weekly
Exec if file_exists('%LOGFILE%') file_cycle('%LOGFILE%', 8);
</Schedule>
Module xm_csv
Fields $date, $time, $s-ip, $cs-method, $cs-uri-stem, $cs-uri-query, $s-port, $cs-username, $c-ip, $cs(User-Agent), $cs(Referer), $sc-status, $sc-substatus, $sc-win32-status, $time-taken
FieldTypes string, string, string, string, string, string, integer, string, string, string, string, integer, integer, integer, integer
Delimiter ' '
QuoteChar '"'
EscapeControl FALSE
UndefValue -
Module im_msvistalog
Query \
\
\
\
\
\
Module im_file
File "C:\\inetpub\\logs\\LogFiles\\W3SVC2\\u_ex*.log"
SavePos TRUE
Exec if $raw_event =~ /^#/ drop(); \
else \
{ \
w3c_parser->parse_csv(); \
$EventTime = parsedate($date + " " + $time); \
$EventTime = strftime($EventTime, "%Y-%m-%dT%H:%M:%SZ"); \
$SourceName = "IIS"; \
$Message = to_json(); \
}
Module om_udp
Host 172.16.20.12
Port 5146
OutputType GELF_UDP
Exec log_info("sending data: " + $raw_event);
Path eventlog => udp
Path iis_w3c => udp
nxlog.log:
2021-08-03 16:05:53 INFO nxlog-ce-2.10.2150 started
2021-08-03 16:17:21 WARNING stopping nxlog service
2021-08-03 16:17:21 WARNING nxlog-ce received a termination request signal, exiting…
2021-08-03 16:17:22 INFO nxlog-ce-2.10.2150 started
2021-08-03 16:44:55 WARNING stopping nxlog service
2021-08-03 16:44:55 WARNING nxlog-ce received a termination request signal, exiting…
2021-08-03 16:44:56 INFO nxlog-ce-2.10.2150 started
2021-08-03 16:50:52 WARNING stopping nxlog service
2021-08-03 16:50:52 WARNING nxlog-ce received a termination request signal, exiting…
2021-08-03 16:50:54 INFO nxlog-ce-2.10.2150 started
2021-08-03 16:50:55 INFO sending data: 2021-08-03 16:50:53 SD-EXTREME-BUE01.fournet.srl INFO 7036 The nxlog service entered the stopped state.
2021-08-03 16:50:55 INFO sending data: 2021-08-03 16:50:54 SD-EXTREME-BUE01.fournet.srl INFO 7036 The nxlog service entered the running state.
2021-08-03 16:52:15 INFO sending data: 2021-08-03 16:52:14 SD-EXTREME-BUE01.fournet.srl INFO 7036 The OSSEC HIDS service entered the stopped state.
2021-08-03 16:52:16 INFO sending data: 2021-08-03 16:52:15 SD-EXTREME-BUE01.fournet.srl INFO 7036 The OSSEC HIDS service entered the running state.
2021-08-03 16:53:10 INFO sending data: 2021-08-03 16:53:08 SD-EXTREME-BUE01.fournet.srl INFO 7036 The W3C Logging Service service entered the running state.
2021-08-03 16:53:14 INFO sending data: 2021-08-03 16:53:12 SD-EXTREME-BUE01.fournet.srl INFO 6200 NT AUTHORITY\SYSTEM date 2021-08-03 time 19:53:09 s-sitename W3SVC2 s-computername SD-EXTREME-BUE01 s-ip 10.0.30.10 cs-method GET cs-uri-stem / cs-uri-query - s-port 8080 cs-username - c-ip 10.34.93.2 cs-version - cs(User-Agent) Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/92.0.4515.107+Safari/537.36 cs(Cookie) - cs(Referer) - cs-host - sc-status 304 sc-substatus 0 sc-win32-status 64 sc-bytes 0 cs-bytes 545 time-taken 1312
2021-08-03 16:53:14 INFO sending data: 2021-08-03 16:53:12 SD-EXTREME-BUE01.fournet.srl INFO 6200 NT AUTHORITY\SYSTEM date 2021-08-03 time 19:53:09 s-sitename W3SVC2 s-computername SD-EXTREME-BUE01 s-ip 10.0.30.10 cs-method GET cs-uri-stem / cs-uri-query - s-port 8080 cs-username - c-ip 10.34.93.2 cs-version - cs(User-Agent) Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/92.0.4515.107+Safari/537.36 cs(Cookie) - cs(Referer) - cs-host - sc-status 200 sc-substatus 0 sc-win32-status 0 sc-bytes 903 cs-bytes 460 time-taken 609
2021-08-03 16:53:38 INFO sending data: 2021-08-03 19:53:09 10.0.30.10 GET / - 8080 - 10.34.93.2 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/92.0.4515.107+Safari/537.36 - 304 0 64 1312
2021-08-03 16:53:38 INFO sending data: 2021-08-03 19:53:09 10.0.30.10 GET / - 8080 - 10.34.93.2 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/92.0.4515.107+Safari/537.36 - 200 0 0 609
2021-08-03 16:58:59 INFO sending data: 2021-08-03 16:58:57 SD-EXTREME-BUE01.fournet.srl INFO 7036 The Sync Host_449c6b0 service entered the stopped state.
2021-08-03 16:59:00 INFO sending data: 2021-08-03 16:58:59 SD-EXTREME-BUE01.fournet.srl INFO 7036 The Sync Host_449c6b0 service entered the running state.
2021-08-03 17:04:39 INFO sending data: 2021-08-03 17:04:38 SD-EXTREME-BUE01.fournet.srl INFO 7036 The Software Protection service entered the running state.
2021-08-03 17:05:10 INFO sending data: 2021-08-03 17:05:08 SD-EXTREME-BUE01.fournet.srl INFO 7036 The Software Protection service entered the stopped state.