Unfortuantely Elastic doesn't produce
docker images going back to 2.x so I can't quickly test against a 2.x instance, but the grok filter hasn't changed much over the years.
This "just works" for me on Logstash 7.5.2 (ignore the input/output sections):
Code: Select all
input {
http {
port => 25565
}
}
filter {
grok {
match => { 'message' => '(?m)%{IPV4:clientip}:%{POSINT:clientport}.*Identity the client attempted to authenticate as:%{DATA:user}Binding%{GREEDYDATA:resten}' }
}
}
output {
stdout {
codec => json
}
}
I put your sample message in:
Code: Select all
curl -XPUT 'http://127.0.0.1:25565' -d 'The following client performed a SASL (Negotiate/Kerberos/NTLM/Digest) LDAP bind without requesting signing (integrity verification), or performed a simple bind over a cleartext on-SSL/TLS-encrypted) LDAP connection.
Client IP address:
10.6.78.9:57348
Identity the client attempted to authenticate as:
DOM\\username\
Binding Type:
1'
I get well-formatted fields out:
Code: Select all
{
"headers": {
"request_method": "PUT",
"request_path": "/",
"http_user_agent": "curl/7.58.0",
"http_version": "HTTP/1.1",
"content_type": "application/x-www-form-urlencoded",
"http_accept": "*/*",
"http_host": "127.0.0.1:25565",
"content_length": "335"
},
"resten": " Type:\n1",
"host": "172.17.0.1",
"@version": "1",
"clientport": "57348",
"user": "\nDOM\\\\username\\\n",
"@timestamp": "2020-02-05T13:39:33.692Z",
"message": "The following client performed a SASL (Negotiate/Kerberos/NTLM/Digest) LDAP bind without requesting signing (integrity verification), or performed a simple bind over a cleartext (non-SSL/TLS-encrypted) LDAP connection.\n\nClient IP address:\n10.6.78.9:57348\nIdentity the client attempted to authenticate as:\nDOM\\\\username\\\nBinding Type:\n1",
"clientip": "10.6.78.9"
}
Granted there's some sketchy new-line stuff in a few of the fields which is fixable in a variety of different ways. Are you sure there aren't other filter rules that may be picking your messages up?