Gsub not work

We have field, need cut symbol from end, we tru use gsub(regexp), but not cuting

mutate {replace => {type => "ztk_login"}
copy => { "host_name" => "host_name_cut" }
gsub => ["host_name_cut", "-ztk\d\d", " "]



t host_name hbk1-ztk05
t host_name_cut hbk1-ztk05
we need first 4 symbol, "hbk1"

when run in debug mode for logstash, see message
14:36:59.624 [[main]>worker1] DEBUG logstash.filters.mutate - gsub mutation is only applicable for Strings, skipping {:field=>"host_name_cut", :value=>nil}

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