title: Modify fluentd json with record_transformer plugin
body: <p>I have logs like this:</p>
  <pre><code>{
      &quot;posts&quot;: {
          &quot;key1&quot;: &quot;value123&quot;,
          &quot;key2&quot;: &quot;abcdge123&quot;,
          &quot;key3&quot;: &quot;abcdge345&quot;,
          &quot;....&quot;: &quot;....&quot;,
          &quot;something&quot;: &quot;something&quot;
      },
      &quot;execute_time&quot;: 123,
      &quot;code&quot;: 200,
  }
  </code></pre>
  <p>Here's fluentd configuration for <code>record_transformer</code>:</p>
  <pre><code>&lt;filter tag.hellow&gt;
    @type record_transformer
    enable_ruby true
    &lt;record&gt;
      posts ${ if record['posts'].has_key?('key1'); Base64.strict_encode64(record['posts']['key1'].to_s); end }
    &lt;/record&gt;
  &lt;/filter&gt;
  </code></pre>
  <p>This deletes the <code>posts</code> field and recreates so that all the other keys in the <code>posts</code> field are lost i.e.:</p>
  <pre><code>{
      &quot;posts&quot;: {
          &quot;key1&quot;: &quot;base64XXXXXXX&quot;
      },
      &quot;execute_time&quot;: 123,
      &quot;code&quot;: 200,
  }
  </code></pre>
  <p>This is the desired log output:</p>
  <pre><code>{
      &quot;posts&quot;: {
          &quot;key1&quot;: &quot;base64XXXXXXX&quot;,
          &quot;key2&quot;: &quot;abcdge123&quot;,
          &quot;key3&quot;: &quot;abcdge345&quot;,
          &quot;....&quot;: &quot;....&quot;,
          &quot;something&quot;: &quot;something&quot;
      },
      &quot;execute_time&quot;: 123,
      &quot;code&quot;: 200,
  }
  </code></pre>
  <p>Is there any way for this use-case?</p>
  <p>Thanks!</p>