Issue with Date Formatting in Transform Script on Elasticsearch 8.6.1


I'm encountering an issue with date formatting in a transform script on Elasticsearch 8.6.1 (licensed version). My goal is to pivot existing index and store the date as it is. However, the output in the transformed index appears in EpochMilli format, even though I am fetching the value from a Date field.

Here's the relevant part of my transform script:

"issueDate": {
        "min": {
          "script": {
            "source": "doc['type.keyword'].value == 'TA' ? doc['createDate'].value : null"

so this is my createDate:
Dec 13, 2023 @ 15:58:40.179

and this is the issueDate after transform:

I have also tried the transform without .value but the issue still persists. My question now is how can I avoid getting the epochmilli value, or if there is not way to avoid it how can I add the conversion inside the transform script?

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