Logstash timer metrics not working -


i using logstash 2.3.4

i receive lignes apache logs small score @ end ( calculated trough machine learning, spark ). here's line :

hackazon.lc:80 192.168.100.133 - - [28/jul/2016:11:07:46 +0200] "get / http/1.1" 200 10442 "http://192.168.100.123/" "mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) chrome/52.0.2743.82 safari/537.36" pred:0.0859964494393 

as can see first part standard apache log , end pred:0.0859964494393.

the logs processed elk visualization, , want have metrics on score called pred. therefore used timer option metrics. here logstash config file :

input {     file {          path => '/home/spark/logstash/*'          start_position => "beginning"     } }  filter {     grok {         match => { "message" => "%{combinedapachelog} pred:%{number:pred_score}"}     }      if "_grokparsefailure" in [tags] {          drop { }     }      mutate {     convert => {"pred_score" => "float"}     }      geoip {          source => "clientip"     }      metrics {         timer => ["pred_score" , "%{duration}"]     }  }  output { #    elasticsearch { }     stdout { codec => rubydebug } #    riemann{ #    map_fields => true #    } } 

i expected output mean, ax etc... of pred score. have 0, except count , rates.

here 1 of output timer :

{       "@version" => "1",     "@timestamp" => "2016-07-28t09:11:39.522z",        "message" => "thamine-optiplex-755",     "pred_score" => {            "count" => 10,          "rate_1m" => 0.5533102865966679,          "rate_5m" => 1.2937302900528778,         "rate_15m" => 1.490591754983121,              "min" => 0.0,              "max" => 0.0,           "stddev" => 0.0,             "mean" => 0.0,               "p1" => 0.0,               "p5" => 0.0,              "p10" => 0.0,              "p90" => 0.0,              "p95" => 0.0,              "p99" => 0.0,             "p100" => 0.0     } } 

do know i'm doing wrong ?

thank's in advance !

your grok pattern looks in logstash script %{duration} unknown. neither combinedapachelog nor pattern has duration variable.

change timer configuration to:

timer => ["pred_score" , "%{pred_score}"] 

as pred_score variable in pattern


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -