Apache Log Files on Windows
Posted: Thu Jan 15, 2015 4:41 pm
Greetings,
There are archived Apache log files on a Windows machine that need to be passed to Logstash for parsing; however, I'm not having any success in doing so. The nxlog client is installed on the Windows machine hosting the archived apache logs and I've edited the windows nxlog.conf file as follows:
....
#
<Input apache-access>
Module im_file
File 'c:\ApacheLogs\request.*'
SavePos TRUE
Exec $Message = $raw_event;
</Input>
#
...
<Output out>
Module om_tcp
Host xxx.xxx.xxx.xxx
Port 3515
Exec $tmpmessage = $Message; delete($Message); rename_field("tmpmessage","message");
Exec $raw_event = to_json();
</Output>
...
#
<Route 1>
Path internal, file1, apache-access, eventlog => out
</Route>
On the Nagios Log Server I've created the following filter:
filter {
if [type] == "apache-access" {
grok {
match => ['message', '%{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-)' ]
}
}
}
Can you please tell me what I'm doing wrong. Thanks in advance
There are archived Apache log files on a Windows machine that need to be passed to Logstash for parsing; however, I'm not having any success in doing so. The nxlog client is installed on the Windows machine hosting the archived apache logs and I've edited the windows nxlog.conf file as follows:
....
#
<Input apache-access>
Module im_file
File 'c:\ApacheLogs\request.*'
SavePos TRUE
Exec $Message = $raw_event;
</Input>
#
...
<Output out>
Module om_tcp
Host xxx.xxx.xxx.xxx
Port 3515
Exec $tmpmessage = $Message; delete($Message); rename_field("tmpmessage","message");
Exec $raw_event = to_json();
</Output>
...
#
<Route 1>
Path internal, file1, apache-access, eventlog => out
</Route>
On the Nagios Log Server I've created the following filter:
filter {
if [type] == "apache-access" {
grok {
match => ['message', '%{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-)' ]
}
}
}
Can you please tell me what I'm doing wrong. Thanks in advance