Documentation error

In the logstash mutete filter documentation there seems to be an error, or at least it seems like an error to me

      mutate {
        split => ["hostname", "."]
        add_field => { "shortHostname" => "%{hostname[0]}" }
    }

does not work, however this works

      mutate {
        split => ["hostname", "."]
        add_field => { "shortHostname" => "%{hostname][0]}" }
    }

Both the field name and the indexing number need to be in square brackets

Indeed. "%{hostname[0]}" worked up until the 7.0 release, at which point it started to result in an error.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.