In the following pipeline, I want to add a shift (1000000) to id
column value, id
was 1, and I want it to be 1000001
. However, with mutate update
generates a string "1 + 1000000"
instead of making integer shifted. I also tried that in output, logstash complains about illegal argument.
filter {
mutate {
copy => { "id" => "[@metadata][_id]"}
remove_field => ["@version"]
}
mutate {
gsub => [ "vec", "[\[\]]", "" ]
split => { "vec" => "," }
#update => { "id" => "%{id} + 1000000} # this results a "1 + 1000000" string id.
}
mutate {
convert => {
"vec" => "float"
}
}
}
output {
stdout { codec => "rubydebug"}
}
output {
elasticsearch {
index => "ff0"
ilm_enabled => false
document_id => "%{id}" + 1000000 # this causes error when run logstash
}
}