# Logstash is not working properly. \_grokparsefailure

**URL:** <https://discuss.elastic.co/t/logstash-is-not-working-properly-grokparsefailure/333851>\
**Category:** Logstash\
**Created:** [May 19, 2023, 9:07am UTC](https://discuss.elastic.co/t/logstash-is-not-working-properly-grokparsefailure/333851 "2023-05-19T09:07:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![San9](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@San9](https://discuss.elastic.co/u/San9)\
**Post date:** [May 19, 2023, 9:07am UTC](https://discuss.elastic.co/t/logstash-is-not-working-properly-grokparsefailure/333851/1 "2023-05-19T09:07:16Z")

</div>

strange behavior of the logstash, everything is parsed in the debugger, but not in the config - gives an error - \_grokparsefailure  
my logs

```auto
10.10.10.10.1680263940261.385400.G_B2C_BETA,03/31/2023 15:02:05.465,sf_sap_put_mr.sap_put_mr_2Z,element,error,error.badfetch: request (http://10.10.10.10:7000/CVP/Server) was timed out after 20000 milliseconds.

```

my config:

```auto
        else if ([message] =~ "error.badfetch:") {
                grok {
                        patterns_dir => ["/etc/logstash/conf.d/patterns"]
                        match => {"message" => "%{IP:ip}.%{IDCUST:id}.%{TEXCUST:app},%{TIMECUST:time},%{TEXCUST2:3rd_integration},%{TEXCUST:element},%{GREEDYDATA:fl},%{GREEDYDATA:msg}"}
             }
                mutate {
                        add_tag => ["badfetch"]
                }
        }

```

and pattern

```auto
IDCUST \d+[^.].\d+[^.]
TIMECUST \d{2}/\d{2}/\d{4} %{TIME}
IP (?<![0-9])(?:(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2}))(?![0-9])
TEXCUST [a-zA-Z0-9-_]+
TEXCUST2 [a-zA-Z0-9-_ .]+|
ALLCUST

```

my screen debugger

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/c/bc360186a69f24f250d8d5425e7abb740a4b956b.png)

what could be the reason for why it does not parse these logs, although in this de configuration else if everything works out well.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/1/7134056b6d3e47334be09c1d123fe0ea7e0c8e4f.png)

Is this not the first time I've encountered this? what could it be?

---

<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 16, 2023, 9:07am UTC](https://discuss.elastic.co/t/logstash-is-not-working-properly-grokparsefailure/333851/2 "2023-06-16T09:07:44Z")

</div>

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