title: illegal_argument_exception while using kafka connector to push to elasticsearch
body: <p>I am trying to push logs from kafka tops to elasticsearch. </p>
  
  <p>My message in kafka:</p>
  
  <pre><code>{
    "@timestamp": 1589549688.659166,
    "log": "13:34:48.658 [pool-2-thread-1] DEBUG health check success",
    "stream": "stdout",
    "time": "2020-05-15T13:34:48.659166158Z",
    "pod_name": "my-pod-789f8c85f4-mt62l",
    "namespace_name": "services",
    "pod_id": "600ca012-91f5-XXXX-XXXX-XXXXXXXXXXX",
    "host": "ip-192-168-88-59.ap-south-1.compute.internal",
    "container_name": "my-pod",
    "docker_id": "XXXXXXXXXXXXXXXXX1435bb2870bfc9d20deb2c483ce07f8e71ec",
    "container_hash": "myregistry",
    "labelpod-template-hash": "9tignfe9r",
    "labelsecurity.istio.io/tlsMode": "istio",
    "labelservice": "my-pod",
    "labelservice.istio.io/canonical-name": "my-pod",
    "labelservice.istio.io/canonical-revision": "latest",
    "labeltype": "my-pod",
    "annotationkubernetes.io/psp": "eks.privileged",
    "annotationsidecar.istio.io/status": "{\"version\":\"58dc8b12bb311f1e2f46fd56abfe876ac96a38d7ac3fc6581af3598ccca7522f\"}"
  }
  </code></pre>
  
  <p>This is my connector config:</p>
  
  <pre><code>{
    "name": "logs",
    "config": {
      "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
      "connection.url": "http://es:9200",
      "connection.username": "username",
      "connection.password": "password",
      "tasks.max": "10",
      "topics": "my-pod",
      "name": "logs",
      "type.name": "_doc",
      "schema.ignore": "true",
      "key.ignore": "true",
      "value.converter": "org.apache.kafka.connect.json.JsonConverter",
      "value.converter.schemas.enable": "false",
      "transforms": "routeTS",
      "transforms.routeTS.type": "org.apache.kafka.connect.transforms.TimestampRouter",
      "transforms.routeTS.topic.format": "${topic}-${timestamp}",
      "transforms.routeTS.timestamp.format": "YYYYMMDD"
    }
  }
  </code></pre>
  
  <p>This is the error i'm getting</p>
  
  <pre><code>cp-kafka-connect-server [2020-05-15 13:30:59,083] WARN Failed to execute batch 4830 of 18 records with attempt 4/6, will attempt retry after 539 ms. Failure reason: Bulk request failed: [{"type":"illegal_argument_exception","reason":"mapper [labelservice] of different type, current_type [text], merged_type [ObjectMapper]"}
  </code></pre>
  
  <p>I haven't created any mapping beforehand. I'm depending on the connector to create the index.
  This is the mapping I have in es which is autocreated.</p>
  
  <pre><code>{
    "mapping": {}
  }
  </code></pre>