Hello,
I've been unable to reference a dynamic field name in my output.
filter{
metrics {
meter => ["%{request}"]
add_tag => "requests"
flush_interval => "5"
clear_interval => "60"
}
}
output {
if "requests" in [tags] {
codec => line {format => " %{request} count: %{[%{request}][count]}"}
}
For each type of request, I'm expecting the %{request} field to contain the name of the particular request type (e.g HTTPRequest, SFTPRequest etc.) with the corresponding count. Instead I get the following in my terminal output:
%{request} count: %{[%{request}][count]}
I understand that it's a referencing issue - If I change things around slightly:
filter{
metrics {
meter => ["Request"]
add_tag => "requests"
flush_interval => "5"
clear_interval => "60"
}
}
output {
if "requests" in [tags] {
codec => line {format => " Request count: %{[Request][count]}"}
}
I can get the following in my output:
Request count: 39
Which proves that it's an issue with referencing the dynamic field name, in this case, the specific request. It doesn't have an issue processing all of the requests at a higher level.
How can I configure my output to ensure that the dynamic field name is processed in the output? I've checked the documentation but haven't had any luck.
This topic is similar to This Thread but it seems that there wasn't an answer that worked.
Much appreciated!