logstash 7.X系列之:logstash采集csv文件并存储至es

input {
  file {
    type => "csv_log_1"
    path => ["D:/date/rs-hf.csv"]  
    start_position => "beginning"
    codec => plain{
      charset=>"UTF-8"
    }
  }
}
filter {
	#字段以及数据类型
  csv {
    separator => ","
    columns =>   ["city","house_address","house_region","house_area","house_id","total_price","unit_price","house_layout","house_floor","house_rental_area","house_structure","house_inner_area","house_building_type","house_orientation","house_building_structure","house_decoration","house_elevator_sytle","house_elevator","house_listing_time","house_transaction_type","house_last_time","house_useage","house_years","house_property","house_mortgage_info","house_book","house_fx_id","house_longitude","house_latitude" ]
  } 
  mutate {
    convert => {
		"city" => "string"
		"house_address" => "string"
		"house_region" => "string"
		"house_area" => "string"
		"house_id" => "string"
		"unit_price" => "string"
		"house_layout" => "string"
		"house_floor" => "string"
		"house_rental_area" => "string"
		"house_structure" => "string"
		"house_inner_area" => "string"
		"house_building_type" => "string"
		"house_orientation" => "string"
		"house_building_structure" => "string"
		"house_decoration" => "string"
		"house_elevator_sytle" => "string"
		"house_elevator" => "string"
		"house_listing_time" => "string"
		"house_transaction_type" => "string"
		"house_last_time" => "string"
		"house_useage" => "string"
		"house_years" => "string"
		"house_property" => "string"
		"house_mortgage_info" => "string"
		"house_book" => "string"
		"house_fx_id" => "string"
		"house_longitude" => "string"
		"house_latitude" => "string"
    }
  }   
}
output {
  elasticsearch {
    action => "index"
    hosts => "*.*.*.*"
    index => "******-%{+YYYY.MM.dd}"
    workers => 1
  }
   stdout{
		 codec => rubydebug
	}
}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值