Skip to content

DateProcessor does not support unix epoch format #26967

@iksnalybok

Description

@iksnalybok

This issue is similar to #26890, but affects the DateProcessor instead of the DateIndexNameProcessor.

Error is

Caused by: java.lang.IllegalArgumentException: field [json.timeMillis] of type [java.lang.Long] cannot be cast to [java.lang.String]
      at org.elasticsearch.ingest.IngestDocument.cast(IngestDocument.java:542)
      at org.elasticsearch.ingest.IngestDocument.getFieldValue(IngestDocument.java:107)
      at org.elasticsearch.ingest.common.DateProcessor.execute(DateProcessor.java:67)
      at org.elasticsearch.ingest.CompoundProcessor.execute(CompoundProcessor.java:100)

To reproduce (tested with local build 7.0.0-alpha1-SNAPSHOT, commitId d97b21d), follow the exact same steps as #26890, except that the definition of the pipeline is:

curl -XPUT "http://localhost:9200/_ingest/pipeline/bugTimestampPipeline" -H 'Content-Type: application/json' -d'
  {
    "description": "bugTimestampPipeline",
    "processors" : [
      {
        "date" : {
          "field" : "json.timeMillis",
          "target_field" : "json.timeHuman",
          "formats" : [ "UNIX_MS", "yyyy-MM-dd HH:mm:ss.SSSZ" ]
        }
      }
    ]
  }'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions