title: How to use if condition in fluentd 0.12
body: <p>I am using fluentd 0.12.</p>
  <p>I have got below logs -</p>
  <pre><code>{&quot;log&quot;:&quot;2020-09-18 19:44:41 | INFO  | timeleft| 5a |  364 - core - 1.0.0.SNAPSHOT | TrafficTo:blue-connectorprocess from: blue-connectorprocess&quot;}
  {&quot;log&quot;:&quot;2020-09-18 19:44:41 | INFO  | timeleft| 6a |  351 - core - 1.0.0.SNAPSHOT | TrafficTo:httpRetrievedata from: retrieveSlaById&quot;}
  {&quot;log&quot;:&quot;2020-09-18 19:44:41 | INFO  | timeleft| 7a |  381 - core - 1.0.0.SNAPSHOT | TrafficTo:PromptConnector from: blue-connectorprocess&quot;}
  </code></pre>
  <p>Now, using regex I have divided the log in several fields -
  TIME | LOG_LEVEL | message| VERSION| TRAFFIC_TO| FROM</p>
  <p>Now, I have requirement that whenever fluentd encounters value &quot;blue-connectorprocess&quot; for field TRAFFIC_TO, it should add new field NEW_TRAFFIC and value of that field should be webconnector.</p>
  <p>Similarly, if value &quot;httpRetrievedata&quot; is encountered in TRAFFIC_TO then NEW_TRAFFIC field should have value uiconnector. and if i encounter value &quot;PromptConnector&quot; then value of NEW_TRAFFIC should be checkconnector.</p>
  <p>I tried below code for one of the TRAFFIC_TO value, but it didn't work.</p>
  <pre><code>&lt;filter sla.**&gt;
    @type record_transformer
    &lt;record&gt;
      NEW_TRAFFIC ${if record[&quot;TRAFFIC_TO&quot;] == &quot;PromptConnector&quot; then record[&quot;NEW_TRAFFIC&quot;] = &quot;checkconnector&quot;; end;}
    &lt;/record&gt;
  &lt;/filter&gt;
  </code></pre>
  <p>Can anyone pls help?</p>