gpt4 book ai didi

csv - Logstash成功启动但不起作用

转载 作者:行者123 更新时间:2023-12-02 22:47:41 25 4
gpt4 key购买 nike

我有与此设置和映射的索引。

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

请帮我。谢谢 :)

最佳答案

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

在您的输入中尝试此配置

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

关于csv - Logstash成功启动但不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59129887/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com