<p>Shipping logs from Kubernetes to Fluentd aggregator.  </p>

<p>Is there a way to transform one of the key values into the tag value?  For example there is key value for application_name. If this could be transformed into the tag value it would be possible to direct to different outputs.</p>

<p>Thanks, </p>

user45097
<p>There is no way to edit the tag once the record is created. </p>

<p>The way to do this is to re-emit the record with the <a href="https://docs.fluentd.org/v0.12/articles/out_rewrite_tag_filter" rel="nofollow noreferrer">rewrite tag filter</a></p>

<p>You could do something like this:</p>

<pre><code>&lt;match kubernetes_logs&gt;
  @type rewrite_tag_filter
  &lt;rule&gt;
    key application_name
    pattern (.+)
    tag $1
  &lt;/rule&gt;
&lt;/match&gt;
</code></pre>

<p>That said, this method makes fluentd to proccess twice as much records. If you only need to direct records to different endpoints, usually output plugins allow to filter records by key.</p>
