title: How to parse bhist log
body: <p>I am using IBM LSF and trying to get usage statistics during a certain period. I found that <code>bhist</code> does the job, but the short form <code>bhist</code> output does not show all of the fields I need.</p>
  
  <p>What I want to know is:</p>
  
  <ol>
  <li><p>Is bhist's output field customizable? The fields I need are:</p>
  
  <ul>
  <li>&lt;jobid> </li>
  <li>&lt;user> </li>
  <li>&lt;queue> </li>
  <li>&lt;job_name> </li>
  <li>&lt;project_name> </li>
  <li>&lt;job_description></li>
  <li>&lt;submission_time> </li>
  <li>&lt;pending_time></li>
  <li>&lt;run_time></li>
  </ul></li>
  <li><p>If <strong>1</strong> is not possible, the long form (<code>bhist -l</code>) output shows everything I need, but the format is hard to manipulate. I've pasted an example of the format below.</p></li>
  </ol>
  
  <p>For example, the number of line between records is not fixed, and the word wrap in each event may break the line in the middle of a word I'm trying to scan for. How do I parse this format with <code>sed</code> and <code>awk</code>?</p>
  
  <pre><code>JobId &lt;1531&gt;, User &lt;user1&gt;, Project &lt;default&gt;, Command&lt; example200&gt;
  Fri Dec 27 13:04:14: Submitted from host &lt;hostA&gt; to Queue &lt;priority&gt;, CWD &lt;$H
                       OME&gt;, Specified Hosts &lt;hostD&gt;;
  Fri Dec 27 13:04:19: Dispatched to &lt;hostD&gt;;
  Fri Dec 27 13:04:19: Starting (Pid 8920);
  Fri Dec 27 13:04:20: Running with execution home &lt;/home/user1&gt;, Execution CWD 
                       &lt;/home/user1&gt;, Execution Pid &lt;8920&gt;;
  Fri Dec 27 13:05:49: Suspended by the user or administrator;
  Fri Dec 27 13:05:56: Suspended: Waiting for re-scheduling after being resumed 
                       by user;
  Fri Dec 27 13:05:57: Running;
  Fri Dec 27 13:07:52: Done successfully. The CPU time used is 28.3 seconds.
  
  Summary of time in seconds spent in various states by Sat Dec 27 13:07:52 1997
  PEND  PSUSP  RUN  USUSP  SSUSP  UNKWN  TOTAL
  5     0      205  7      1      0      218
  ------------------------------------------------------------
      .... repeat
  </code></pre>