title: Ruby calling AWS ELB functions
body: <p>I'm writing some Ruby scripts to wrap AWS ELB command line calls, mostly so that I can act on several ELB instances simultaneously. One task is to use the elb-describe-instance-health call to see what instance IDs are attached to this ELB. </p>
  
  <p>I want to match the Instance ID to a nickname we have set up for those instances, so that I can see at a glance what machines area connected to the ELB, without having to look up the instance names.</p>
  
  <p>So I am issuing:</p>
  
  <pre><code>cmd = "elb-describe-instance-health #{elbName}"
  value = `#{cmd}`
  </code></pre>
  
  <p>Passing the elb name into the call. This returns output such as:</p>
  
  <pre><code>INSTANCE_ID  i-jfjtktykg  InService  N/A  N/A
  INSTANCE_ID  i-ujelforos  InService  N/A  N/A
  </code></pre>
  
  <p>One line appear for each instance in the ELB. There are two spaces between each field.</p>
  
  <p>What I need to get is the second field, which is the actual instance ID. Basically I'm trying to get each line returned, turn it into an array, get the 2nd field, which I can then use to lookup our server nickname. </p>
  
  <p>Not sure if this is the right approach, but any suggestions on how to get this done are very welcome.</p>