# Filter first . | debug("Filtering...") | .tags[] |= select(.typeId == "Cooling/TH/TH_Model2_v3") # Sort first | debug("Sorting...") | walk( if type == "object" and has("tags") then .tags |= sort_by(.name) end ) # so object positions are predictable | .tags[0].tags[1].tags as $baseData | debug("Modifing parameters...") | walk( # Removes .Tags.Controller Tags from the plcName parameter if type == "object" and has("plcName") then .plcName.value |= rtrimstr(".Tags.Controller Tags") elif type == "object" and has("plcname") then .plcname.value |= rtrimstr(".Tags.Controller Tags") end ) # and can be used as the base line to setup the other objects | debug("Copying Data folder...") | walk( if type == "object" and .name? == "Data" then .tags = $baseData end )