简体   繁体   中英

Logstash Metrics Output

I'm using metrics filter in two fields (backend_name) (http_request) but my output is not working, I'm trying to write this to a csv. someone have a idea what is going on?

grok {
    match => {"message" =>'%{HAPROXYHTTP}'}
}

metrics {
    meter => [ "%{backend_name} %{http_request}" ]
    add_tag => "metric"
}

output {
    file {
        path => "/home/netcool/Desktop/teste.csv"
        codec => line { format => "rate: %{[%{backend_name} %{http_request}] %[rate_1m]}" }
    }
}

stdout { 
    codec => rubydebug 
}

The filter ( metrics & grok ) plugins should be in the brackets of a filter {} and the output plugin stdout should be in output{} .

For your configuration, it would look like this:

filter {
    grok {
        match => {"message" =>'%{HAPROXYHTTP}'}
    }

    metrics {
        meter => [ "%{backend_name} %{http_request}" ]
        add_tag => "metric"
    }
}

output {
    file {
        path => "/home/netcool/Desktop/teste.csv"
        codec => line { format => "rate: %{[%{backend_name} %{http_request}] %[rate_1m]}" }
    }

    stdout { 
        codec => rubydebug 
    }
}   

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM