title: Fluent D record_transformer plugin and Ruby for eventual use with elasticsearch,Kibana
body: <p>I am currently using the fluentd record_transformer plugin to transform syslog messages. I wanted to know how to implement this set of c++ commands in ruby to find a comma and get a substring up to that position and store it in a new field (Duration):</p>
  
  <pre><code>std::string str="We think in generalities, but we live in details.";
  std::size_t pos = str.find(',');
  std::string newstring = str.substr (3,pos);
  </code></pre>
  
  <p>I have tried :</p>
  
  <pre><code>&lt;filter xyz.**&gt;
  @type record_transformer
  enable_ruby true
  &lt;record&gt;
  Duration ${record["message"][32..(("message".index(/\,/,32)).to_i)]}
  &lt;/record&gt;
  </code></pre>
  
  <p>But have been unsuccessful. I acknowledge this is a rather basic question, but all help will be greatly appreciated.</p>