Hi team,
i have tags array in my mongodb contacts collection, which contain mongodb ids, its store as
"tags":[{"$oid":"61822c908200c6b810bfee4d"},{"$oid":"61822c908200c6b810bfee4e"}]
i want to rename all elements of mongo ids inside tags array to "documentId" like i did for _id field :
filter {
mutate {
rename =>{ "[_id]" => "documentId"}
}
}
which give output as
"documentId" => "6188d0be3d5bd73e9bb78dd6",
i am just failing in renaming all element of tags array which is also array of mongodb ids
please help
i am stuck since five days
here my logdash config file
input {
mongodb{
uri => 'mongodb://127.0.0.1:27017/makeEmails'
placeholder_db_dir => '/opt/logstash/'
placeholder_db_name => 'logstash_sqlite.db'
collection => 'contacts'
batch_size => 5000
}
}
filter {
mutate {
rename =>{ "[_id]" => "documentId"}
}
}
output {
stdout {
codec => rubydebug
}
Elasticsearch {
action => "index"
index => "contact_log"
hosts => ["localhost:9200"]
user => "elastic"
password => "DYLDnjpyMHcnRbdfOckY"
codec => json
}
}