input {
file {
path => "F:\elasticsearch\movielens\ml-latest-small\movies.csv"
start_position => "beginning"
sincedb_path => "F:\elasticsearch\movielens\ml-latest-small\aaa"
}
}
filter {
csv {
separator => ","
columns => ["id","content","genre"]
}
mutate {
split => { "genre" => "|" }
remove_field => ["path", "host","@timestamp","message"]
}
mutate {
split => ["content", "("]
add_field => { "title" => "%{[content][0]}"}
add_field => { "year" => "%{[content][1]}"}
}
# mutate {
# gsub => [
#
# "year", "\\)", ""
# ]
# }
mutate {
convert => {
"year" => "integer"
}
strip => ["title"]
remove_field => ["path", "host","@timestamp","message","content"]
}
}
output {
elasticsearch {
hosts => "http://192.168.93.1:9200"
index => "movies"
document_id => "%{id}"
}
stdout {}
}
报错信息
Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create<main>, action_result: false", :backtrace=>nil}
file {
path => "F:\elasticsearch\movielens\ml-latest-small\movies.csv"
start_position => "beginning"
sincedb_path => "F:\elasticsearch\movielens\ml-latest-small\aaa"
}
}
filter {
csv {
separator => ","
columns => ["id","content","genre"]
}
mutate {
split => { "genre" => "|" }
remove_field => ["path", "host","@timestamp","message"]
}
mutate {
split => ["content", "("]
add_field => { "title" => "%{[content][0]}"}
add_field => { "year" => "%{[content][1]}"}
}
# mutate {
# gsub => [
#
# "year", "\\)", ""
# ]
# }
mutate {
convert => {
"year" => "integer"
}
strip => ["title"]
remove_field => ["path", "host","@timestamp","message","content"]
}
}
output {
elasticsearch {
hosts => "http://192.168.93.1:9200"
index => "movies"
document_id => "%{id}"
}
stdout {}
}
报错信息
Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create<main>, action_result: false", :backtrace=>nil}
0 个回复