HI Team ,
i'm using metrics filter plugin for different files with their respective count. but i'm unable to get the metrics results.
here is my logstash conf
input{
reading log file here
}
filter{
**using grok to extract file_name **
metrics {
meter => ["%{file_name}"]
add_tag => "metrics"
id => "file_count"
}
}
output {
if "metrics" in [tags] {
stdout {
codec => line {
format => " %{file_name} --> COUNT : %{[file_name][count]}"
}
}
}
OUTPUT i'm getting is
%{file_name} -->COUNT : %{[file_name][count]}
%{file_name} -->COUNT : %{[file_name][count]}
%{file_name} -->COUNT : %{[file_name][count]}
Expected output
file1--> COUNT:100
file2--> COUNT:100
file3--> COUNT:100
could you please help here?