I've noticed some people use the 3rd part in a grok matching predicate, like
%{NUMBER:response_status:int}
^--- ??
It's obvious what first 2 mean, and I can guess that the 3rd one is an explicit type of the result, but I cannot find the comprehensive explanation of what that 3rd part is.
I checked in both Logstash documentation and in Grok's one and cannot see any traces of the comprehensive syntax description.
Any references?
UPD:
here is an example that it works and is syntactically correct:
For the config file:
input { stdin { } }
filter {
grok {
match => [
"message", "%{NUMBER:a_number:float}"
]
}
}
output { stdout { codec => rubydebug } }
The output for the 12345
is:
{
"message" => "12345",
"@version" => "1",
"@timestamp" => "2014-10-08T01:08:49.087Z",
"host" => "logstash",
"a_number" => 12345.0
}
If you remove :float
then it changes to
{
"message" => "12345",
"@version" => "1",
"@timestamp" => "2014-10-08T01:09:46.055Z",
"host" => "logstash",
"a_number" => "12345"
}
This is true for at least logstash v1.4.2