# Elasticsearch grok processor error

**URL:** <https://discuss.elastic.co/t/elasticsearch-grok-processor-error/121510>\
**Category:** Elasticsearch\
**Created:** [February 26, 2018, 2:52pm UTC](https://discuss.elastic.co/t/elasticsearch-grok-processor-error/121510 "2018-02-26T14:52:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![saiergon](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@saiergon](https://discuss.elastic.co/u/saiergon)\
**Post date:** [February 26, 2018, 2:52pm UTC](https://discuss.elastic.co/t/elasticsearch-grok-processor-error/121510/1 "2018-02-26T14:52:44Z")

</div>

hi, can anybody tell me why this is error:

POST /\_ingest/pipeline/\_simulate  
{  
"pipeline": {  
"description": "filebeat pipeline",  
"processors": [  
{  
"grok": {  
"field": "message",  
"patterns": ["%{TIMESTAMP\_ISO8601}:x"]  
}  
}  
]  
},  
"docs": [  
{  
"\_index": "index",  
"\_type": "\_doc",  
"\_id": "id",  
"\_source": {  
"message": "2017-10-12 13:12:32"  
}  
}  
]  
}

when i post this, the response is IllegalArgumentException, detailed error information is:

{  
"docs": [  
{  
"error": {  
"root\_cause": [  
{  
"type": "exception",  
"reason": "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Provided Grok expressions do not match field value: [2017-10-12 13:12:32]",  
"header": {  
"processor\_type": "grok"  
}  
}  
],  
"type": "exception",  
"reason": "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Provided Grok expressions do not match field value: [2017-10-12 13:12:32]",  
"caused\_by": {  
"type": "illegal\_argument\_exception",  
"reason": "java.lang.IllegalArgumentException: Provided Grok expressions do not match field value: [2017-10-12 13:12:32]",  
"caused\_by": {  
"type": "illegal\_argument\_exception",  
"reason": "Provided Grok expressions do not match field value: [2017-10-12 13:12:32]"  
}  
},  
"header": {  
"processor\_type": "grok"  
}  
}  
}  
]  
}

thanks a lot

---

<div class="post-metadata">

**Author:** ![saiergon](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@saiergon](https://discuss.elastic.co/u/saiergon)\
**Post date:** [February 27, 2018, 2:14am UTC](https://discuss.elastic.co/t/elasticsearch-grok-processor-error/121510/2 "2018-02-27T02:14:16Z")

</div>

> [@saiergon](#):
>
> ssage",
> 
> "patterns": ["%{TIMESTAMP\_ISO8601

it's my fault, i should use %{TIMESTAMP\_ISO8601:x} instead of %{TIMESTAMP\_ISO8601}:x...

---

<div class="post-metadata">

**Author:** ![saiergon](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@saiergon](https://discuss.elastic.co/u/saiergon)\
**Post date:** [February 27, 2018, 2:54am UTC](https://discuss.elastic.co/t/elasticsearch-grok-processor-error/121510/3 "2018-02-27T02:54:04Z")

</div>

i found if i use elasticsearch grok processor, pattern TIMESTAMP\_ISO8601 can not mach value "2017-10-12 1:12:32.232", but logstash grok can match. The follow is my use case

```auto
POST /_ingest/pipeline/_simulate
{
  "pipeline": {
    "description": "filebeat pipeline",
  "processors": [
    {"grok": {
      "field": "message",
      "patterns": ["%{TIMESTAMP_ISO8601:logtime}"]
    }
    }]
  },
  "docs": [
    {
      "_index": "index",
      "_type": "_doc",
      "_id": "id",
      "_source": {
        "message": "2017-10-12 1:12:32.232"
      }
    }
    ]
}

```

and the resonse is:

```auto
{
  "docs": [
    {
      "error": {
        "root_cause": [
          {
            "type": "exception",
            "reason": "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Provided Grok expressions do not match field value: [2017-10-12 1:12:32.232]",
            "header": {
              "processor_type": "grok"
            }
          }
        ],
        "type": "exception",
        "reason": "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Provided Grok expressions do not match field value: [2017-10-12 1:12:32.232]",
        "caused_by": {
          "type": "illegal_argument_exception",
          "reason": "java.lang.IllegalArgumentException: Provided Grok expressions do not match field value: [2017-10-12 1:12:32.232]",
          "caused_by": {
            "type": "illegal_argument_exception",
            "reason": "Provided Grok expressions do not match field value: [2017-10-12 1:12:32.232]"
          }
        },
        "header": {
          "processor_type": "grok"
        }
      }
    }
  ]
}

```

but if i set message value as "2017-10-12 01:12:32.232", its ok. so the hour value must have two numbers in elasticsearch grok processor?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 27, 2018, 1:05pm UTC](https://discuss.elastic.co/t/elasticsearch-grok-processor-error/121510/4 "2018-02-27T13:05:42Z")

</div>

the ES grok processor is more strict here. You should try to avoid truncated representations of dates, as especially with different formatting this may lead to ambiguous dates.

---

<div class="post-metadata">

**Author:** ![saiergon](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@saiergon](https://discuss.elastic.co/u/saiergon)\
**Post date:** [February 28, 2018, 2:09am UTC](https://discuss.elastic.co/t/elasticsearch-grok-processor-error/121510/5 "2018-02-28T02:09:57Z")

</div>

ok，thanks

---

<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:** [March 28, 2018, 2:09am UTC](https://discuss.elastic.co/t/elasticsearch-grok-processor-error/121510/6 "2018-03-28T02:09:59Z")

</div>

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