Eliminating nested each
You can iterate over the hashes/arrays using a custom enumerator (modified from a StackOverflow answer here):

def dfs(obj, &amp;blk)
  return enum_for(:dfs, obj) unless blk      
  yield obj if obj.is_a? Hash
  if obj.is_a?(Hash) || obj.is_a?(Array)
    obj.each do |*a|
      dfs(a.last, &amp;blk)
    end
  end
end


You can then use this enumerator builder method in any number of other helper methods for whatever you need. For example, to perform your example search, you could define:

def find_node_with_value(obj, key, value)
  dfs(obj).select do |node|
    node[key].respond_to?(:include?) &amp;&amp; node[key].include?(value)
  end
end


And then use it like:

find_node_with_value(json_data, "field1", "something")
# [{"entry_id"=&gt;544, "field1"=&gt;"something" ...}, {"entry_id"=&gt;546, "field1"=&gt;"something!" ...}]