data_bag("users").each do |user_name| user_data = data_bag_item("users", user_name) log "found #{user_data.id}" end or, using search: search("users","*:*").each do |user| log "found #{user.id}" end