hey there,
my grok filter for IIS logs is not working on logstash, however it worok on kibana debugger:
input {
beats {
port => 5044
type => "log"
port=> 5044
type => "iis"
}
filter {
if [type] == "iis" {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:log_timestamp} %{WORD:S-SiteName} %{NOTSPACE:S-ComputerName} %{IPORHOST:S-IP} %{WORD:CS-Method} %{URIPATH:CS-URI-Stem} (?:-|"%{URIPATH:CS-URI-Query}") %{NUMBER:S-Port} %{NOTSPACE:CS-Username} %{IPORHOST:C-IP} %{NOTSPACE:CS-Version} %{NOTSPACE:CS-UserAgent} %{NOTSPACE:CS-Cookie} %{NOTSPACE:CS-Referer} %{NOTSPACE:CS-Host} %{NUMBER:SC-Status} %{NUMBER:SC-SubStatus} %{NUMBER:SC-Win32-Status} %{NUMBER:SC-Bytes} %{NUMBER:CS-Bytes} %{NUMBER:Time-Taken}"}
remove_field => ["message"]
}
}
}
output {
elasticsearch {
hosts => "10.175.142.92:9200"
manage_template => false
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
}}
in Kibana the logs are showing like this:
{
"_index": "filebeat-2019.01.14",
"_type": "doc",
"_id": "X8LOTGgBdSYGhbv_YsLO",
"_version": 1,
"_score": null,
"_source": {
"beat": {
"hostname": "U4VMUSPUISITG11",
"name": "U4VMUSPUISITG11",
"version": "6.5.4"
},
"input": {
"type": "log"
},
"host": {
"os": {
"platform": "windows",
"family": "windows",
"build": "9200.22620",
"version": "6.2"
},
"name": "U4VMUSPUISITG11",
"id": "e2b6035c-59e1-49c1-be70-dffd00525749",
"architecture": "x86_64"
},
"@version": "1",
"offset": 464770,
"@timestamp": "2019-01-14T14:40:19.532Z",
"source": "D:\Logfiles\W3SVC1\u_ex19011414.log",
"prospector": {
"type": "log"
},
"tags": [
"beats_input_codec_plain_applied"
],
"type": "log",
"message": "2019-01-14 14:39:47 W3SVC1 U4VMUSPUISITG11 10.160.227.166 GET /Customer/Load a=4002229&p=04&b=3696&ac=&ro=EBD%20-%20Queue%20Sales%20Rep%20Brazil 80 americas\ServiceUspCPNonPrd 10.175.140.244 HTTP/1.1 Mozilla/5.0+(X11;+Linux+x86_64;+Catchpoint)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/59.0.3071.115+Safari/537.36 - - u4vmuspuisitg11.olqa.preol.dell.com 302 0 0 716 527 946"
},
"fields": {
"@timestamp": [
"2019-01-14T14:40:19.532Z"
]
},
"sort": [
1547476819532
]
}
i would appreciate some help here!