# Beats setup.template date format only accepts string, url, or date

**URL:** https://discuss.elastic.co/t/beats-setup-template-date-format-only-accepts-string-url-or-date/304636
**Category:** Beats
**Tags:** filebeat
**Created:** [May 13, 2022, 5:46am UTC](https://discuss.elastic.co/t/beats-setup-template-date-format-only-accepts-string-url-or-date/304636 "2022-05-13T05:46:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![eddyariki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddyariki/32/105633_2.png) [@eddyariki](https://discuss.elastic.co/u/eddyariki)
#### Post date: [May 13, 2022, 5:46am UTC](https://discuss.elastic.co/t/beats-setup-template-date-format-only-accepts-string-url-or-date/304636/1 "2022-05-13T05:46:12Z")

</div>

In my filebeat configuration, I am trying to append a field of type date with a format specified.

```auto
setup.template:
  overwrite: false
  append_fields:
  - name: testfield
    type: date
    format: "dd/MMM/yyyy:HH:mm:ss Z"

```

However, I get the following error:

```auto
Exiting: unpacking template config fails: incorrect type configuration for field 'testfield': unexpected format 'dd/MMM/yyyy:HH:mm:ss Z' for field 'testfield', expected one of: string, url, date accessing 'setup.template.append_fields.0' (source:'filebeat.yml')

```

I am using Elasticsearch:8.2.0 and Filebeats:8.2.0.

According to the sourcecode, the [accepted formatters](https://github.com/elastic/beats/blob/main/libbeat/mapping/field.go#L181) only include string, url, and date, and doesn't allow for custom formatters. Why is this the specification?

In order to apply custom formatters, I will have to use component templates, but it would be ideal if it can be set in the filebeats config.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 10, 2022, 7:47am UTC](https://discuss.elastic.co/t/beats-setup-template-date-format-only-accepts-string-url-or-date/304636/2 "2022-06-10T07:47:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
