title: Renaming the field with special character with Simple Message Transform Kafka Connect
body: <p>I'm using SMT in Splunk Sink Connector and having trouble with renaming the field. I need to change name of the field from, for example, &quot;metric1&quot; into &quot;metric_name:cpu.usr&quot;.</p>
  <p>That's how configurations of my connector look like:</p>
  <pre><code>SPLUNK_SINK_CONNECTOR_CONFIG='{
   &quot;name&quot;: &quot;splunk_sink_connector_1&quot;,
    &quot;config&quot;: {
      &quot;connector.class&quot;: &quot;com.splunk.kafka.connect.SplunkSinkConnector&quot;,
      &quot;tasks.max&quot;: &quot;1&quot;,
      &quot;splunk.indexes&quot;: &quot;'&quot;$SPLUNK_INDEX&quot;'&quot;,
      &quot;topics&quot;:&quot;metrics_for_splunk&quot;,
      &quot;splunk.hec.uri&quot;: &quot;'&quot;$SPLUNK_HEC_URI&quot;'&quot;,
      &quot;splunk.hec.token&quot;: &quot;'&quot;$SPLUNK_HEC_TOKEN&quot;'&quot;,
      &quot;splunk.hec.raw&quot;: &quot;true&quot;,
      &quot;offset.flush.interval.ms&quot;: 1000,
      &quot;splunk.hec.json.event.formatted&quot;: &quot;true&quot;,
  
       &quot;transforms&quot;: &quot;renameField,HoistField,insertTS,convertTS,insertEvent&quot;,
  
      &quot;transforms.renameField.type&quot;: &quot;org.apache.kafka.connect.transforms.ReplaceField$Value&quot;,
      &quot;transforms.renameField.renames&quot;: &quot;metric1:&quot;metric_name:cpu.usr&quot;&quot;,
      &quot;transforms.HoistField.type&quot;: &quot;org.apache.kafka.connect.transforms.HoistField$Value&quot;,
      &quot;transforms.HoistField.field&quot;: &quot;fields&quot;,
      &quot;transforms.insertTS.type&quot;: &quot;org.apache.kafka.connect.transforms.InsertField$Value&quot;,
      &quot;transforms.insertTS.timestamp.field&quot;: &quot;message_timestamp&quot;,
      &quot;transforms.convertTS.type&quot;: &quot;org.apache.kafka.connect.transforms.TimestampConverter$Value&quot;,
      &quot;transforms.convertTS.format&quot;: &quot;yyyy-MM-dd hh:mm&quot;,
      &quot;transforms.convertTS.target.type&quot;: &quot;string&quot;,
      &quot;transforms.convertTS.field&quot;: &quot;message_timestamp&quot;,
      &quot;transforms.insertEvent.type&quot;: &quot;org.apache.kafka.connect.transforms.InsertField$Value&quot;,
      &quot;transforms.insertEvent.static.field&quot;: &quot;event&quot;,
      &quot;transforms.insertEvent.static.value&quot;: &quot;metric&quot;
  }}'
  </code></pre>
  <p>When I'm trying to run this connector, I get an error:</p>
  <blockquote>
  <p>Connector configuration is invalid and contains the following 1 error(s):\nInvalid value [metric1:metric_name:cpu.usr] for configuration renames: Invalid rename mapping: metric1:metric_name:cpu.usr\n</p>
  </blockquote>
  <p>If I'm running this connector without renameField SMT everything goes without a hitch.</p>
  <p>I understand that the problem is with &quot;:&quot; character in the name of the field. I've tried to wrap metric_name:cpu.usr like this:</p>
  <blockquote>
  <p>&quot;transforms.renameField.renames&quot;: &quot;metric1:'metric_name:cpu.usr'&quot;</p>
  </blockquote>
  <p>and like this</p>
  <blockquote>
  <p>&quot;transforms.renameField.renames&quot;: &quot;metric1:'&quot;metric_name:cpu.usr&quot;'&quot;</p>
  </blockquote>
  <p>and like this</p>
  <blockquote>
  <p>&quot;transforms.renameField.renames&quot;: &quot;metric1:&quot;metric_name:cpu.usr&quot;&quot;</p>
  </blockquote>
  <p>and use escape character \ before :</p>
  <p>&quot;transforms.renameField.renames&quot;: &quot;metric1:metric_name:cpu.usr&quot;</p>
  <p>with no positive effect.</p>
  <p>Is it possible at all to use this SMT for renaming if I have special character in the name?
  Or maybe there is some handy workaround?
  It seems that this use case should be rather common, but I haven't found anything on the web.
  Will be very grateful for advice.</p>