我正在使用logstash,弹性搜索和Kibana。 输入文件是.csv格式
我首先通过Dev Tools>创建了以下映射。控制台在Kibana:
PUT /defects
{
"mappings": {
"type_name":{
"properties" : {
"Detected on Date" :{
"type": "date"
},
"DEFECTID": {
"type": "integer"
}
}
}
}
}
成功了。然后创建了一个logstash conf文件并运行它。
这是我的logstash.conf文件:
input {
file {
path => ["E:/d drive/ELK/data/sample.csv"]
start_position => "beginning"
sincedb_path => "/dev/nul"
}
}
filter {
csv {
columns => ["DEFECTID","Detected on Date","SEVERITY","STATUS"]
separator => ","
}
}
output {
elasticsearch {
action => "index"
hosts => "localhost:9200"
manage_template => false
template_overwrite => true
index => "defects"
}
}
我在Kibana中创建了索引模式缺陷*。当我查看字段的类型时,所有字符都显示为字符串。请告诉我我失踪的地方