logstash csv ma​​p列未硬编码

时间:2015-08-17 09:38:24

标签: csv generics logstash hardcode

我正在尝试通用映射csv文件,因此列的顺序无关紧要。我知道怎么做:

input {
  file {
    path => "/opt/tradertools/omer/omer.csv"
    type => "csv"
  }

  filter {
   if [type] == "csv" {
   csv{
   columns => ["col example 1","col example 2"]
   }

   output {
  stdout { codec => rubydebug }

  file {
        path => "/var/log/logstash/%{type}OMER.%{+yyyy.MM.dd.HH}"
    }
}

但如果我切换csv列顺序,我还需要更改代码......有人有了想法吗?

0 个答案:

没有答案