如何在logstash中加载CSV文件

如何在logstash中加载CSV文件,logstash,Logstash,我试图在logstash中加载CSV文件,但它没有读取该文件,也没有在elasticsearch中创建索引 我需要在elasticsearch中读取CSV文件。 尝试在配置文件中进行一些更改 我的配置文件 input { file { type => "csv" path => "/root/installables/*.csv" start_position => beginning } } filter {

我试图在logstash中加载CSV文件,但它没有读取该文件,也没有在elasticsearch中创建索引 我需要在elasticsearch中读取CSV文件。 尝试在配置文件中进行一些更改

我的配置文件

input {
    file {
        type => "csv"
        path => "/root/installables/*.csv"
        start_position => beginning
    }
}

filter {
    grok {
        match => { "message" => "%{COMBINEDAPACHELOG}" }
    }
}

output {
    elasticsearch {
        hosts => localhost
        index => "client"
    }
}
谁能告诉我如何在日志库中加载CSV文件吗?

我想你应该设置一个“CSV”过滤器。我让它像这样工作:

input {
  file {
    path => "/filepath..."
    start_position => beginning
    # to read from the beginning of file
    sincedb_path => "/dev/null"
  }
}

filter {
    csv {
        columns => ["COL1", "COL2"]
    }
}

output {
    stdout { codec => rubydebug }
    elasticsearch {
        host => "localhost"
        index => "csv_index"
    }
}

另外,将标准输出添加为输出有助于调试并了解文件是否正在加载

什么是sincedb?为什么我们需要提到它?我需要安装CSV插件吗?如果需要,那么如何安装?logstash将读取文件的偏移量存储在名为.sincedb的文件夹中。设置为null将强制重新处理所有文件。CSV筛选器是日志存储分发的一部分。不,它没有在ES中创建索引。sincedb的路径是相同的还是会是其他的?