Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker logstash-input-file start error "cannot unmarshal !!str input {... into map[string]interface {}" #22

Open
EverSpring opened this issue Sep 27, 2020 · 1 comment

Comments

@EverSpring
Copy link

Hi:
docker version: 19.03.13
logstash version: 7.4.0
run command:
docker run -d --name logstash-test -v /home/docker/logstash.conf:/usr/share/logstash/config/logstash.yml logstash:7.4.0
logstash.yml:
`
input {
file {
path => "/home/docker/movies.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
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 {
convert => {
"year" => "integer"
}
strip => ["title"]
remove_field => ["path", "host","@timestamp","message","content"]
}

}
output {
elasticsearch {
hosts => "http://es-cluster:9200"
index => "movies"
document_id => "%{id}"
user => "es"
password => "pwd"
}
stdout {}
}
**report error**:cannot unmarshal !!str input {... into map[string]interface {}`

Can you help me to fix it ,thanks

@koskoskos
Copy link

Hi: docker version: 19.03.13 logstash version: 7.4.0 run command: docker run -d --name logstash-test -v /home/docker/logstash.conf:/usr/share/logstash/config/logstash.yml logstash:7.4.0 logstash.yml: ` input { file { path => "/home/docker/movies.csv" start_position => "beginning" sincedb_path => "/dev/null" } } 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 { convert => { "year" => "integer" } strip => ["title"] remove_field => ["path", "host","@timestamp","message","content"] }

} output { elasticsearch { hosts => "http://es-cluster:9200" index => "movies" document_id => "%{id}" user => "es" password => "pwd" } stdout {} } **report error**:cannot unmarshal !!str input {... into map[string]interface {}`

Can you help me to fix it ,thanks

Did you solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants