# \_grokparsefailure while reading logs from file by logstash

**URL:** <https://discuss.elastic.co/t/-grokparsefailure-while-reading-logs-from-file-by-logstash/40285>\
**Category:** Logstash\
**Created:** [January 27, 2016, 8:27pm UTC](https://discuss.elastic.co/t/-grokparsefailure-while-reading-logs-from-file-by-logstash/40285 "2016-01-27T20:27:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maciej.kola](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maciej.kola](https://discuss.elastic.co/u/maciej.kola)\
**Post date:** [January 27, 2016, 8:27pm UTC](https://discuss.elastic.co/t/-grokparsefailure-while-reading-logs-from-file-by-logstash/40285/1 "2016-01-27T20:27:26Z")

</div>

Hi Mates,

Can anyone please tell me, why I got "\_grokparsefailure" while reading logs from file? My logs look like this:

2016-01-27T21:17:31+01:00 10.1.2.132 %ASA-1-302013: Built outbound TCP connection 890918059 for test:10.3.3.54/2222 (10.3.3.54/2222) to inside:192.24.3.103/62065 (192.24.3.103/62065)

I have searched forum and google and I found out that grok thinks that it's not a "syslog style" log. But it is (at least it is a file saved by rsyslog on CentOS 7 so I assume that it's compatible with RFC).

My grok filter:

filter {  
if [type] == "syslog" {  
grok {  
match =\> { "message" =\> "\<%{POSINT:syslog\_pri}\>%{SYSLOGTIMESTAMP:syslog\_timestamp} %{SYSLOGHOST:syslog\_hostname} %{DATA:syslog\_program}(?:[%{POSINT:syslog\_pid}])?: %{GREEDYDATA:syslog\_message}" }  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 28, 2016, 7:24am UTC](https://discuss.elastic.co/t/-grokparsefailure-while-reading-logs-from-file-by-logstash/40285/2 "2016-01-28T07:24:44Z")

</div>

Your grok expression isn't even close to matching the actual log data. The grok expresion you use would parse a log that looks something like this:

```
<13>Jan 28 08:21:29 hostname smartd[4016]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 32 to 33

```

Your expression should probably begin like this:

```
%{TIMESTAMP_ISO8601:syslog_timestamp} %{IP:host}
```

---

<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:** [July 6, 2017, 5:13am UTC](https://discuss.elastic.co/t/-grokparsefailure-while-reading-logs-from-file-by-logstash/40285/3 "2017-07-06T05:13:59Z")

</div>


