【问题标题】:Logstash start successfully but doesn't workLogstash 启动成功但不起作用
【发布时间】:2020-03-26 12:47:12
【问题描述】:

我有一个包含此设置和映射的索引。

PUT /amazon_products
{
"settings": {
  "number_of_shards": 1,
  "number_of_replicas": 0,
  "analysis": {
    "analyzer": {}
    }
 },
"mappings": {
  "properties": {
    "id": {
      "type": "keyword"
     },
    "title": {
      "type": "text"
    },
    "description": {
      "type": "text"
    },
    "manufacturer": {
      "type": "text",
      "fields": {
        "raw": {
          "type": "keyword"
        }
      }
    },
    "price": {
      "type": "scaled_float",
      "scaling_factor": 100
      }
    }
  }
}

这个字段也存在于我的 .csv 文件中,我想使用 logstash 将我的数据从 csv 文件发送到 elasticsearch
这是我的 logstash 配置文件:

input {
  file {
    path => "E:\ElasticStack\Logstash\products.csv"
    start_position => "beginning"
    sincedb_path => "NULL"
   }
}
filter {
  csv {
      separator => ","
      columns => ["id","title","description","manufacturer","price"]
  }
}
output {
  elasticsearch {
     hosts => "http://localhost:9200"
     index => "amazon_products"
  }
  stdout {}
}

如果使用此命令.\logstash -f ..\config\logstash.conf 来自 logstash 的唯一消息是:
已成功启动 Logstash API 端点 {:port=>9600},它不会向 elasticsearch 发送数据
请帮我。谢谢你:)

【问题讨论】:

    标签: csv elasticsearch logstash kibana elastic-stack


    【解决方案1】:

    即使在 Windows 上,也可以在路径配置中使用正斜杠,还将 sincedb_path 更改为 NUL

    在您的输入中尝试此配置

    input {
      file {
        path => "E:/ElasticStack/Logstash/products.csv"
        start_position => "beginning"
        sincedb_path => "NUL"
       }
    }
    

    【讨论】:

      【解决方案2】:

      尝试将sincedb_path 参数设置为“NUL”。

      【讨论】:

      猜你喜欢
      • 2015-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-26
      • 1970-01-01
      • 2016-10-31
      • 1970-01-01
      • 2021-06-22
      相关资源
      最近更新 更多