【问题标题】:Use Logstash CSV filter doesn't work使用 Logstash CSV 过滤器不起作用
【发布时间】:2015-06-28 00:38:54
【问题描述】:

我试图在 Logstash 上使用 CSV 过滤器,但它可以上传我的文件的值。 我正在使用 Ubuntu Server 14.04、kibana 4、logstash 1.4.2 和 elasticsearch 1.4.4。 接下来我展示我编写的 CSV 文件和过滤器。我做错了吗?


CSV 文件:

Joao,21,555
Miguel,24,1000
Rodrigo,43,443
Maria,54,2343
Antonia,67,213

Logstash CSV 过滤器:

#Este e filtro que le o ficheiro e permite alocar os dados num index do Elasticsearch
input
{
    file
    {
       path => ["/opt/logstash/bin/testeFile_lite.csv"]
       start_position => "beginning"
       # sincedb_path => "NIL"
    }
}
filter
{
    csv
    {
        columns => ["nome", "idade", "salario"]
        separator => ","
    }
}
output
{
    elasticsearch
    {
        action => "index"
        host => "localhost"
        index => "logstash-%{+YYYY.MM.dd}"
    }
    stdout
    {
        codec => rubydebug
    }
}

当我执行过滤器时,出现:使用里程碑 2 输入插件 'file'... 并使用里程碑 2 输入插件 'csv'... 并且没有出现 OK 消息。

有人可以帮助我吗?

【问题讨论】:

    标签: csv logstash elastic-stack


    【解决方案1】:

    我解决了在输入文件中添加字段 sincedb_path 的问题。

    这是 Logstash CSV 过滤器:

    input
    {
          file
            {
               path => "/opt/logstash/bin/testeFile_lite.csv"
               type => "testeFile_lite"
               start_position => "beginning"
               sincedb_path => "/opt/logstash/bin/dbteste"
            }
    }
    filter
    {
        csv
          {
               columns => ['nome', 'idade', 'salario']
               separator => ","
          }
    
    }
    output
    {
        elasticsearch
        {
           action => "index"
           host => "localhost"
           index => "xpto"
           cluster => "SIC_UTAD"
        }
    
        stdout
        {
            codec => rubydebug
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-10
      • 2019-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-16
      相关资源
      最近更新 更多