去除字段注意
- 只能去除_source里的
2. 非_source里的去除不了
Logstash配置去除不需要的字段
[root@server12 ~]# vim /usr/local/logstash-6.6.0/config/logstash.conf
filter {
grok {
match => {
“message” => ‘(?[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}) - - [(? [^ ]+ +[0-9]+)] “(? [A-Z]+) (? [^ ]+) HTTP/\d.\d” (? [0-9]+) (? [0-9]+) “[^”]+” “(? [^”]+)”‘
}
remove_field => [“message”,”@version”,”path”]
}
}
[root@server12 ~]# kill -1ps aux | grep logstash | awk '{print $2}'
去除字段
3. 减小ES数据库的大小
4. 提升搜索效率