Page 1 of 2

Unable to ship DHCP logs

Posted: Wed Feb 27, 2019 4:22 pm
by dlukinski
Hello LOG Support

We are unable to ship DHCP logs to the LOG server:

failed to open directory: C:\\Windows\\system32\\dhcp: The system cannot find the path specified. "}

------------------------------------------------------------
<Input windowsfile>
Module im_file
File 'C:\Windows\system32\dhcp\dhcpsvrlog*.*' or 'C:\Windows\system32\dhcp\dhcpsvrlog*'
SavePos TRUE
# ReadFromLast FALSE
Exec $Message = $raw_event;
</Input>
-------------------------------------------------------------
- just does not work

Please help

Re: Unable to ship DHCP logs

Posted: Thu Feb 28, 2019 10:46 am
by cdienger
"Or" doesn't appear to be a valid option. Try:

Code: Select all

<Input windowsfile>
Module im_file
File 'C:\Windows\system32\dhcp\dhcpsvrlog*'
SavePos TRUE
# ReadFromLast FALSE
Exec $Message = $raw_event;
</Input>
test again, and PM me a complete copy of the configuration as well as nxlog.log if there are still problems.

Re: Unable to ship DHCP logs

Posted: Mon Mar 04, 2019 9:48 am
by dlukinski
cdienger wrote:"Or" doesn't appear to be a valid option. Try:

Code: Select all

<Input windowsfile>
Module im_file
File 'C:\Windows\system32\dhcp\dhcpsvrlog*'
SavePos TRUE
# ReadFromLast FALSE
Exec $Message = $raw_event;
</Input>
test again, and PM me a complete copy of the configuration as well as nxlog.log if there are still problems.
----------------------------------------------------------------------------------------------------------------------------------------
Hi

By OR I meant trying both paths (no luck)
Attached conf file.
---------------------
#
# Logstash Configuration File
# Dynamically created by Nagios Log Server
#
# DO NOT EDIT THIS FILE. IT WILL BE OVERWRITTEN.
#
# Created Mon, 04 Mar 2019 14:48:31 +0000
#

#
# Global inputs
#

input {
tcp {
port => 514
type => switchlog
}
udp {
port => 514
type => switchlog
}
tcp {
type => 'eventlog'
port => 3515
codec => json {
charset => 'CP1252'
}
}
tcp {
type => 'import_raw'
tags => 'import_raw'
port => 2056
}
tcp {
type => 'import_json'
tags => 'import_json'
port => 2057
codec => json
}
tcp {
port => 4444
type => SIEBELappLOG
}
udp {
port => 4444
type => SIEBELappLOG
}
tcp {
port => 4445
type => TCappLOG
}
udp {
port => 4445
type => TCappLOG
}
tcp {
type => 'ADFSeventlog'
port => 3516
codec => json {
charset => 'CP1252'
}
}
tcp {
port => 5544
type => syslog
}
udp {
port => 5544
type => syslog
}
tcp {
port => 4446
type => SKYBOTappLOG
}
udp {
port => 4446
type => SKYBOTappLOG
}
tcp {
port => 4447
type => EFECTEappLOG
}
udp {
port => 4447
type => EFECTEappLOG
}
tcp {
port => 5545
type => syslog
}
udp {
port => 5545
type => syslog
}
tcp {
port => 4448
type => RPAROBPappLOG
}
udp {
port => 4448
type => RPAROBPappLOG
}
tcp {
port => 4450
type => SELENIUMLOG
}
udp {
port => 4450
type => SELENIUMLOG
}
tcp {
port => 5546
type => DHCPlog
}
udp {
port => 5546
type => DHCPlog
}
}

#
# Local inputs
#



#
# Global filters
#

filter {
if [program] == 'apache_access' {
grok {
match => [ 'message', '%{COMBINEDAPACHELOG}']
}
date {
match => [ 'timestamp', 'dd/MMM/yyyy:HH:mm:ss Z' ]
}
mutate {
replace => [ 'type', 'apache_access' ]
convert => [ 'bytes', 'integer' ]
convert => [ 'response', 'integer' ]
}
}

if [program] == 'apache_error' {
grok {
match => [ 'message', '\[(?<timestamp>%{DAY:day} %{MONTH:month} %{MONTHDAY} %{TIME} %{YEAR})\] \[%{WORD:class}\] \[%{WORD:originator} %{IP:clientip}\] %{GREEDYDATA:errmsg}']
}
mutate {
replace => [ 'type', 'apache_error' ]
}
}
if [type] == "syslog" {
grok {
match => { "message" => "<%{POSINT:pri}>%{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:logsource} %{DATA:program}(?:\[%{POSINT:pid}\])?: %{GREEDYDATA:syslog_message}" }
}
}
}

#
# Local filters
#



#
# Global outputs
#



#
# Local outputs
#

Re: Unable to ship DHCP logs

Posted: Mon Mar 04, 2019 11:26 am
by cdienger
Try replacing 'system32' with 'Sysnative' per the comment in https://nxlog.co/question/1848/nxlogcon ... -file-path

Re: Unable to ship DHCP logs

Posted: Mon Mar 04, 2019 1:28 pm
by dlukinski
cdienger wrote:Try replacing 'system32' with 'Sysnative' per the comment in https://nxlog.co/question/1848/nxlogcon ... -file-path

Same error:

{"EventTime":"2019-03-04 16:46:19","Hostname":"FIKC-DHCP02","SeverityValue":4,"Severity":"ERROR","SourceName":"nxlog-ce","ProcessID":6916,"ErrorCode":720003,"EventReceivedTime":"2019-03-04 16:46:19","SourceModuleName":"internal","SourceModuleType":"im_internal","message":"failed to open directory: C:\\Windows\\system32\\dhcp: The system cannot find the path specified. "}

Re: Unable to ship DHCP logs

Posted: Tue Mar 05, 2019 11:33 am
by cdienger
Can you provide the current nxlog.conf using the sysnative directory so that we can confirm the config? I've been able to reproduce the problem and this resolved the problem in my case. What version of Windows and nxlog is currently installed? An update to the package that ships with NLS can be found at https://nxlog.co/products/nxlog-communi ... n/download. Try the latest to see if that resolves the issue.

Re: Unable to ship DHCP logs

Posted: Wed Mar 06, 2019 9:23 am
by dlukinski
cdienger wrote:Can you provide the current nxlog.conf using the sysnative directory so that we can confirm the config? I've been able to reproduce the problem and this resolved the problem in my case. What version of Windows and nxlog is currently installed? An update to the package that ships with NLS can be found at https://nxlog.co/products/nxlog-communi ... n/download. Try the latest to see if that resolves the issue.
Hi, here is the conf file attached

We now get this error:
"Module windowsfile has no input files to read"

Re: Unable to ship DHCP logs

Posted: Wed Mar 06, 2019 1:26 pm
by cdienger
That may be promising - I get the same message if there isn't a file in that directory that matches the wildcard expression. Is there a file in there that matches DhcpSvrLog-*.log ? Make sure there aren't any spaces hiding in the name.

Re: Unable to ship DHCP logs

Posted: Wed Mar 06, 2019 5:26 pm
by dlukinski
cdienger wrote:That may be promising - I get the same message if there isn't a file in that directory that matches the wildcard expression. Is there a file in there that matches DhcpSvrLog-*.log ? Make sure there aren't any spaces hiding in the name.
All these files as attached (live server), but nothing is being shipped to Nagios Log

Re: Unable to ship DHCP logs

Posted: Thu Mar 07, 2019 11:54 am
by cdienger
Try creating a new folder, configuring nxlog to pull logs from that new folder, and then copying the files over to the new folder. I'm not sure what nxlog seems to be having a problem finding these files, but this may be a work around.