【发布时间】: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