本文主要是介绍如何在logstash的配置文件里边删除csv中columns中多余的field字段,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
当采集数据时生成的csv的文件,但是发现采集表数据有些在es中不需要,这时,可以在filter插件中的csv中,使用remove_field => [ "filed1","filed2" ]来删除多余字段
input {
file {
path => [
"/test/111.csv"
]
start_position => "beginning" #从什么位置读取,beginnig时导入原有数据
sincedb_path => "/test/111"
type => "111"
tags => ["optical", "gather"]
}
}
filter {
if [type] == "111" { #多个配置文件同时执行的区分
csv {
columns =>["gathertime","device_id","oltip","devicename","vendor_id","oltportinfo","oltsendpower","oltrecvpower","onuid","onuip","onusn","onumac","
这篇关于如何在logstash的配置文件里边删除csv中columns中多余的field字段的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!