# Grok problem and logstash

**URL:** <https://discuss.elastic.co/t/grok-problem-and-logstash/181081>\
**Category:** Logstash\
**Created:** [May 14, 2019, 11:44pm UTC](https://discuss.elastic.co/t/grok-problem-and-logstash/181081 "2019-05-14T23:44:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![franco.federico](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@franco.federico](https://discuss.elastic.co/u/franco.federico)\
**Post date:** [May 14, 2019, 11:44pm UTC](https://discuss.elastic.co/t/grok-problem-and-logstash/181081/1 "2019-05-14T23:44:03Z")

</div>

I have an old version of logstash exactly1.5.6

I have made a grok filter and I created it by [http://grokdebug.herokuapp.com/](http://grokdebug.herokuapp.com/)

For grokdebug it is ok and I have my field. Here the example of grok filter and example of line

```
%{TIMESTAMP_ISO8601:received_at} %{GREEDYDATA:} %{USERNAME:username} %{IP:calling_station_id}.*LOG: %{GREEDYDATA:audit_type}:.*

2019-03-15 00:00:02 CET [unknown] postgres 192.168.9.11 976LOG: AUDIT: SESSION,4506,1,FUNCTION,EXECUTE,FUNCTION,gimp.prparameters_get_value,"SELECT * FROM gimp.prparameters_get_value('EMAIL_SENDER_ADDRESS',NULL)",<not logged>

```

Now I try to load in elasticsearch by logstash and I always have \_grokparserfailure.

I try to reduce the grok filter and at the end with this simple configuration I have the same error

The configuration is

> ```
> filter {
> if [message] =~ /^\s*Safed\[/ {
> mutate {
> replace => ["source", "Safed"]
> }
> }
> if [source] == "Safed"{
> # Safed without stripped syslog-tag "Safed[...][...]"
> # SAMPLE AUDIT
> # 03-15-2019 00:00:02 CET [unknown] postgres 192.168.9.11 976LOG: AUDIT: SESSION,4506,1,FUNCTION,EXECUTE,FUNCTION,gimp.prparameters_get_value,"SELECT * FROM gimp.prparameters_get_value('EMAIL_SENDER_ADDRESS',NULL)",<not logged>
> grok {
> patterns_dir => "/var/lib/neteye/logstash/etc/pattern.d"
> match => ["message","%{DATESTAMP:prova_date}.*"]
> overwrite => ["message"]
> remove_tag => "_grokparsefailure"
> break_on_match => false
> }
> }
> }
> 
> ```

What is the problem of my little configuration?

Thank you  
Franco

---

<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 11, 2019, 11:44pm UTC](https://discuss.elastic.co/t/grok-problem-and-logstash/181081/2 "2019-06-11T23:44:04Z")

</div>

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