# Date processor ingest pipeline failed to parse

**URL:** https://discuss.elastic.co/t/date-processor-ingest-pipeline-failed-to-parse/304515
**Category:** Elasticsearch
**Tags:** ingest-pipeline
**Created:** [May 12, 2022, 3:08am UTC](https://discuss.elastic.co/t/date-processor-ingest-pipeline-failed-to-parse/304515 "2022-05-12T03:08:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![alfianaf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alfianaf/32/93192_2.png) [@alfianaf](https://discuss.elastic.co/u/alfianaf)
#### Post date: [May 12, 2022, 3:08am UTC](https://discuss.elastic.co/t/date-processor-ingest-pipeline-failed-to-parse/304515/1 "2022-05-12T03:08:31Z")

</div>

Hello,  
I'm using date processor on ingest pipeline, I've seen the documentation about the date processor, the syntax I wrote seems right, but the result is not.  
here's my date example

```auto
05/11/2022, 7:03:52 AM

```

and here's my date processor

```auto
      {
      "date" : {
        "field" : "timestamp",
        "target_field" : "@timestamp",
        "formats" : ["mm/dd/yyyy, h:mm:ss a"],
        "timezone" : "UTC"
      }

```

here's the error

```auto
{
  "docs" : [
    {
      "error" : {
        "root_cause" : [
          {
            "type" : "illegal_argument_exception",
            "reason" : "unable to parse date [05/11/2022, 7:03:52 AM]"
          }
        ],
        "type" : "illegal_argument_exception",
        "reason" : "unable to parse date [05/11/2022, 7:03:52 AM]",
        "caused_by" : {
          "type" : "illegal_argument_exception",
          "reason" : "failed to parse date field [05/11/2022, 7:03:52 AM] with format [mm/dd/yyyy, h:mm:ss a]",
          "caused_by" : {
            "type" : "date_time_parse_exception",
            "reason" : "Text '05/11/2022, 7:03:52 AM' could not be parsed at index 14"
          }
        }
      }
    }
  ]
}

```

anyone have any clue about this? I tried to trim the field first yet still experiencing same issue

any help is appreciated,  
Thanks

---

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [May 12, 2022, 3:25am UTC](https://discuss.elastic.co/t/date-processor-ingest-pipeline-failed-to-parse/304515/2 "2022-05-12T03:25:17Z")

</div>

Hi @alfianaf

Fixing the **formats** to "MM/dd/yyyy".

```auto
PUT _ingest/pipeline/test_date
{
  "description" : "...",
  "processors" : [
    {
      "date" : {
        "field" : "timestamp",
        "target_field" : "@timestamp",
        "formats" : ["MM/dd/yyyy, h:mm:ss a"],
        "timezone" : "UTC"
      }
    }
  ]
}

POST _ingest/pipeline/test_date/_simulate
{
  "docs": [
    {
      "_source": {
        "timestamp": "05/11/2022, 07:03:52 AM"
      }
    }
  ]
}

```

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 12, 2022, 3:28am UTC](https://discuss.elastic.co/t/date-processor-ingest-pipeline-failed-to-parse/304515/3 "2022-05-12T03:28:23Z")

</div>

@RabBit_BR Beat me to it...

Did you try...

`"MM/dd/yyyy, HH.mm.ss a"`

Or

`"MM/dd/yyyy, h.mm.ss a"`

---

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [May 12, 2022, 3:35am UTC](https://discuss.elastic.co/t/date-processor-ingest-pipeline-failed-to-parse/304515/4 "2022-05-12T03:35:41Z")

</div>

I tried `"MM/dd/yyyy, h:mm:ss a"`

---

<div class="post-metadata">

### Author: ![alfianaf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alfianaf/32/93192_2.png) [@alfianaf](https://discuss.elastic.co/u/alfianaf)
#### Post date: [May 12, 2022, 3:45am UTC](https://discuss.elastic.co/t/date-processor-ingest-pipeline-failed-to-parse/304515/5 "2022-05-12T03:45:41Z")

</div>

its fixed now, my bad I thought mm was the correct format,  
thanks all

---

<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 9, 2022, 3:46am UTC](https://discuss.elastic.co/t/date-processor-ingest-pipeline-failed-to-parse/304515/6 "2022-06-09T03:46:35Z")

</div>

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