I have an IIS filter that seems to test fine using the grok debugger however I am not seeing any messages indexed in Kibana via filebeat. Here is my beats.conf
input{
beats{
port => "5043"
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:[%{POSINT:syslog_pid}])?: %{GREEDYDATA:syslog_message}" }
}
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
if [type] == "iis_log" {
if [message] =~ "^#" {
drop {}
}
grok {
match => { "message" => [ "%{TIMESTAMP_ISO8601:log_timestamp} %{WORD:iisSite} %{IPORHOST:site} %{WORD:method} %{URIPATH:page} %{NOTSPACE:querystring} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clienthost} %{NOTSPACE:useragent} %{NOTSPACE:referer}" ] }
}
}
}
output{
elasticsearch {
hosts => ["192.168.1.1:9200"]
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
}
Here is an excerpt from the IIS log:
#Fields: date time s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken
2018-02-28 08:33:38 host123 192.168.1.100 GET /some/internal/directory - 443 user@emailaddress.com 192.168.1.101 product/version+build;+iOS+version)+product/1.0 - site.external.com 123 0 0 233 123 4321
The grok debugger tells me that some of my fields are matching what IIS logs are supplying.
Here is the filebeat.yml
filebeat.prospectors:
-
type: log
enabled: false
paths:
- e:\Web Logs\W3SVC**.log
document_type: iis_log
- e:\Web Logs\W3SVC**.log
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 3
tags: ["location", "web Farm"]
fields:
environment: production
setup.kibana:
host: "192.168.1.1:5601"
output.logstash:
hosts: ["192.168.1.1:5043"]