How to get date to format correctly

Hello,

In transforms can you specify an index template for mappings? Or set the date format? My source index has a timestamp properly formatted using strict_date_optional_time||epoch_millis. When it goes to the transform index I lose the formatting. I have the following settings in a transform:


      "dest" : {
        "index" : "transform_test",
        "pipeline": "date_format_transform"

Where the pipeline date_formatt_transform turns the timestamp into strict_date_optional_time||epoch_millis However everytime I check the mappings of my new index my date is just "date" with no formatting:

        "timestamp" : {
          "type" : "date"
        },

I tried specifying the date formatting directly as well:

     "timestamp" : {
        "date_histogram" : {
          "field" : "timestamp",
          "format" : "strict_date_optional_time||epoch_millis",
          "calendar_interval" : "1d"
        }

But I get the error:

[data_frame_date_histogram_group] unknown field [format]

Please advise

Hi,

You have to set the mappings of the destination index before the transform ingesting documents. If transform ingest documents before set mappings, field types are determined by Elasticsearch dynamically.

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