Skip to content

Cannot access event['field'] after use metrics. #39

@MichelLiu

Description

@MichelLiu

Here is my logstash configuration file:

input { ... }

filter{
grok {
patterns_dir => ["/usr/local/logstash-2.3.4/patterns/"]
pattern => "%{NGINXPROXY}"
}
...

ruby {
    code "ss=event['httpstatus'];print ss" #Here can print the value
}
metrics {
    meter => "error_%{httpstatus}"
    add_tag => "metric"
    ignore_older_than => 10
}
ruby {
    code "ss=event['httpstatus'];print ss" #Here I supposed to access nginx 'httpstatus',but get result 'nil'
}

}

output {
stdout => {codec = rubydebug}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions