.. meta:: :description: This document provides usage information for the Apache Kafka SMT org.apache.kafka.connect.transforms.ExtractField. .. _extractfield: ============ ExtractField ============ The following provides usage information for the |ak-tm| SMT ``org.apache.kafka.connect.transforms.ExtractField``. Description ----------- ``ExtractField`` pulls a field out of a complex (non-primitive, Map or Struct) key or value and replaces the entire key or value with the extracted field. Any ``null`` values are passed through unmodified. Use the concrete transformation type designed for the record key (``org.apache.kafka.connect.transforms.ExtractField$Key``) or value (``org.apache.kafka.connect.transforms.ExtractField$Value``). Examples -------- The following examples show how to use ``ExtractField`` by itself and in conjunction with a second SMT. ------------------ Extract Field Name ------------------ The configuration snippet below shows how to use ``ExtractField`` to extract the field name ``"id"``. .. code-block:: json "transforms": "ExtractField", "transforms.ExtractField.type": "org.apache.kafka.connect.transforms.ExtractField$Value", "transforms.ExtractField.field": "id" Before: ``{"id": 42, "cost": 4000}`` After: ``42`` .. tip:: For additional examples, see `ExtractField `__ for managed connectors. Properties ---------- .. list-table:: :header-rows: 1 :widths: 15 30 10 10 10 10 * - Name - Description - Type - Default - Valid Values - Importance * - ``field`` - Field name to extract. - string - - - medium .. include:: includes/Example_ValueToKeyExtractField.rst .. include:: includes/predicate.rst