logstash : Mutate { gsub … } not working

时光怂恿深爱的人放手 提交于 2020-01-24 12:42:08

问题


    mutate {
        add_field => {"eee" => "2016 uaie"}
        gsub => [
            "eee", "2016", "2015"
        ]
   }

This will indeed create a field "eee", but gsub will not update it. Why?


回答1:


add_field runs when the underlying filter succeeds. In your case, the mutate{} is being run and then the add_field is run.

To have the mutate{} after the field is added, use two mutate blocks:

mutate {
    add_field => {"eee" => "2016 uaie"}
}

mutate {
    gsub => [
        "eee", "2016", "2015"
    ]
}


来源:https://stackoverflow.com/questions/34596364/logstash-mutate-gsub-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!