It works pretty well for most of the collections, that really great. Is it about how you write the second argument in the gsub? I tried writing the mutations for the rest sometimes it would take some values, other times it would stay the same, missing some in the process.
{
"@version" => "1",
"application" => "mongo-skills",
"mongo_id" => "5ff86b44ff600800171ec9ab",
"@timestamp" => 2021-10-05T07:52:21.633Z,
"name" => "Gestión",
"created_at" => "2021-01-08T14:25:08Z",
"updated_at" => "2021-01-08T14:25:08Z",
"logdate" => "2021-01-08T14:25:08+00:00",
"host" => "DESKTOP-KPJ5TLR",
"__v" => 0,
"log_entry" => "{\"_id\": \"5ff86b44ff600800171ec9ab\", \"active\": true, \"transversal\": false, \"skill\": [\"5ff85b46ff600800171ec962\", \"5ff76a36ff600800171ec7ba\", \"5ff76a36ff600800171ec7bb\", \"5ff76a36ff600800171ec7bc\", \"5ff76a36ff600800171ec7be\", \"5ff76a36ff600800171ec7bf\", \"5ff76a36ff600800171ec7c6\", \"5ff76a36ff600800171ec7c8\", \"5ff76a36ff600800171ec7c9\"], \"name\": \"Gestión\", \"domain\": \"5ff768ebff600800171ec7b7\", \"created_at\": 2021-01-08 14:25:08 UTC, \"updated_at\": 2021-01-08 14:25:08 UTC, \"__v\": 0}"
}
{
"@version" => "1",
"application" => "mongo-skills",
"mongo_id" => "5ff86bb7ff600800171ec9ac",
"@timestamp" => 2021-10-05T07:52:21.637Z,
"name" => "Investigación de usuarios",
"created_at" => "2021-01-08T14:27:03Z",
"updated_at" => "2021-01-08T14:27:03Z",
"logdate" => "2021-01-08T14:27:03+00:00",
"host" => "DESKTOP-KPJ5TLR",
"__v" => 0,
"log_entry" => "{\"_id\": \"5ff86bb7ff600800171ec9ac\", \"active\": true, \"transversal\": false, \"skill\": [\"5ff85b03ff600800171ec961\", \"5ff76b03ff600800171ec7fb\", \"5ff76b03ff600800171ec802\", \"5ff76b03ff600800171ec80c\", \"5ff76b03ff600800171ec815\", \"5ff76b03ff600800171ec818\", \"5ff76b03ff600800171ec820\", \"5ff76b03ff600800171ec821\", \"5ff76b03ff600800171ec822\", \"5ff76b03ff600800171ec823\"], \"name\": \"Investigación de usuarios\", \"domain\": \"5ff7698cff600800171ec7b8\", \"created_at\": 2021-01-08 14:27:03 UTC, \"updated_at\": 2021-01-08 14:27:03 UTC, \"__v\": 0}"
}
{
"@version" => "1",
"application" => "mongo-skills",
"mongo_id" => "6005f0f420856a001839e791",
"@timestamp" => 2021-10-05T07:52:21.646Z,
"name" => "Soft Abilities",
"created_at" => "2021-01-18T20:35:00Z",
"updated_at" => "2021-01-18T20:35:00Z",
"logdate" => "2021-01-18T20:35:00+00:00",
"host" => "DESKTOP-KPJ5TLR",
"__v" => 0,
"log_entry" => "{\"_id\": \"6005f0f420856a001839e791\", \"active\": true, \"transversal\": false, \"skill\": [\"6005ed4120856a001839e790\"], \"name\": \"Soft Abilities\", \"domain\": \"5ff76884ff600800171ec7b6\", \"created_at\": 2021-01-18 20:35:00 UTC, \"updated_at\": 2021-01-18 20:35:00 UTC, \"__v\": 0}"
}
{
"@version" => "1",
"application" => "mongo-skills",
"mongo_id" => "609451c8c200c300175310fa",
"@timestamp" => 2021-10-05T07:52:21.649Z,
"name" => "ignacio ",
"created_at" => "2021-05-06T20:30:00Z",
"updated_at" => "2021-05-06T20:30:00Z",
"logdate" => "2021-05-06T20:30:00+00:00",
"host" => "DESKTOP-KPJ5TLR",
"__v" => 0,
"log_entry" => "{\"_id\": \"609451c8c200c300175310fa\", \"active\": true, \"transversal\": false, \"skill\": [\"604b77ca79d1960017f55aca\", \"5ff76ef5ff600800171ec8b0\", \"5ff76ef5ff600800171ec8a7\"], \"name\": \"ignacio \", \"domain\": \"5ff75f1eff600800171ec7af\", \"created_at\": 2021-05-06 20:30:00 UTC, \"updated_at\": 2021-05-06 20:30:00 UTC, \"__v\": 0}"
}
{
"@version" => "1",
"application" => "mongo-skills",
"mongo_id" => "60945209c200c300175310fb",
"@timestamp" => 2021-10-05T07:52:21.651Z,
"name" => "ignacio montero",
"created_at" => "2021-05-06T20:31:05Z",
"updated_at" => "2021-05-06T20:31:05Z",
"logdate" => "2021-05-06T20:31:05+00:00",
"host" => "DESKTOP-KPJ5TLR",
"__v" => 0,
"log_entry" => "{\"_id\": \"60945209c200c300175310fb\", \"active\": true, \"transversal\": false, \"skill\": [\"5ff76b76ff600800171ec828\", \"60180a275ea72a001713ea4f\", \"5ff76ef5ff600800171ec8a9\"], \"name\": \"ignacio montero\", \"domain\": \"5ff75f1eff600800171ec7af\", \"created_at\": 2021-05-06 20:31:05 UTC, \"updated_at\": 2021-05-06 20:31:05 UTC, \"__v\": 0}"
Tags seems to just be shown as two open brackets, so the failure doesn't matter much since it has no values.
{
"logdate" => "2021-01-18T20:35:00+00:00",
"@timestamp" => 2021-10-05T07:59:13.387Z,
"updated_at" => "2021-01-18T20:35:00Z",
"__v" => 0,
"mongo_id" => "6005f0f420856a001839e791",
"log_entry" => "{\"_id\": \"6005f0f420856a001839e791\", \"active\": true, \"transversal\": false, \"skill\": [\"6005ed4120856a001839e790\"], \"name\": \"Soft Abilities\", \"domain\": \"5ff76884ff600800171ec7b6\", \"created_at\": 2021-01-18 20:35:00 UTC, \"updated_at\": 2021-01-18 20:35:00 UTC, \"__v\": 0}",
"name" => "Soft Abilities",
"@version" => "1",
"created_at" => "2021-01-18T20:35:00Z",
"tags" => [
[0] "_jsonparsefailure"
],
"host" => "DESKTOP-KPJ5TLR",
"application" => "mongo-skillsets",
"_id" => "6005f0f420856a001839e791"
}
Any other suggestions on how to mutate would be greatly appreciated