title: search specific string in a value from Json and assign to variable in ruby
body: <p>Here is my json file</p>
  
  <pre><code>{
    "osNameSpace" : "prod",
    "bucketNames" : [ "RC_osbackup_config_d0007cz_idfdafa3", "IC_osbackup_vman_d0007cz_dasdc3w" ],
    "user" : "RC_osbackup_svc_user_d0007cz_dasf2fd",
    "userOcid" : "rcid1.user.oc1..aaaaaaaazf5e27hbpst2pxarisi5qvkmgotwm5ro4nhjkkjq4mmxengckv2a",
    "group" : "RC_osbackup_svc_grp_d0007cz_asdf24"
  }
  </code></pre>
  
  <p>I want to search for a string 'osbackup_config' and assign to 'os_conf' variable. similarly for string 'osbackup_vman' to 'os_vman'</p>
  
  <p>I tried the following, but no luck </p>
  
  <pre><code>input_file="/root/testjson_2.json"
  r = JSON.parse(File.read(input_file))
  
  r["bucketNames"].find {|r1| r1['dbbackup_rman']=='rman'}['rman_bucket_name']
  r["bucketNames"].find {|r1| r1['dbbackup_config']=='config'}['config_bucket_name']
  </code></pre>