[source, ruby]
----
response = client.cluster.put_component_template(
  name: 'template_1',
  body: {
    template: {
      settings: {
        number_of_shards: 1
      },
      mappings: {
        _source: {
          enabled: false
        },
        properties: {
          host_name: {
            type: 'keyword'
          },
          created_at: {
            type: 'date',
            format: 'EEE MMM dd HH:mm:ss Z yyyy'
          }
        }
      }
    }
  }
)
puts response
----
