# Probleme with grock logstash 5.0

**URL:** <https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149>\
**Category:** Logstash\
**Created:** [December 6, 2016, 9:45am UTC](https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149 "2016-12-06T09:45:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pierre](https://discuss.elastic.co/u/pierre)\
**Post date:** [December 6, 2016, 9:45am UTC](https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149/1 "2016-12-06T09:45:30Z")

</div>

hey,

i have a problem with logstash, syntax of logstash.

my log is :  
14\>1 **2016-03-02T14:26:10.620+01:00** AAAAAAA-AAAA AA\_AAAA- AA\_FLOW\_SESSION\_CLOSE  
[blablabla@2222.2.1.1.2.222 reason="idle Timeout" **source-address="8.8.8.8"**  
**source-port="8" destination-address="8.8.8.8"**  
**destination-port="8" service-name="udp"**  
nat-source-address="8.8.8.8" nat-source-port="8"  
nat-destination-address="8.8.8.8"  
nat-destination-port="8" src-nat-rule-type="N/A"  
src-nat-rule-name="N/A" dst-nat-rule-type="N/A"  
dst-nat-rule-name="N/A" **protocol-id="8"**  
**policy-name="test\_1"**  
**source-zone-name="test\_2" destination-zone-name="test-3"**  
session-id-32="8" packets-from-client="1"  
**bytes-from-client="108"** packets-from-server="0"  
**bytes-from-server="0"** elapsed-time="60"  
application="UNKNOWN" nested-application="UNKNOWN"  
username="N/A" roles="N/A" packet-incoming-interface="eth0"  
encrypted="UNKNOWN"] session closed idle

i want keep **strong text**

my grok is :

filter {  
grok {  
match =\> { "message" =\> " %{DATA} %{TIMESTAMP\_ISO8601:Date}%{DATA}source-address="%{IP:ip\_source\_address}" source-port="%{NUMBER:source\_port}" destination-address="%{IP:ip\_destination\_address}" destination-port="%{NUMBER:destination\_port}" service-name="%{WORD:service\_name}" %{DATA} protocol-id="%{NUMBER:protocol\_id}" policy-name="%{DATA:policy\_name}" source-zone-name="%{DATA:source\_zone\_name}" destination-zone-name="{DATA:destination\_zone\_name}" " }  
}  
}  
if you test this on : [https://grokdebug.herokuapp.com/](https://grokdebug.herokuapp.com/) it's ok but in logstash after a configtest i have an error , plz help me

---

<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:** [December 6, 2016, 10:06am UTC](https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149/2 "2016-12-06T10:06:09Z")

</div>

If you want double quotes inside the grok expression I suggest you make the expression single quoted, i.e. do

```
match => { "message" => ' %{DATA}...' }

```

instead of this:

```
match => { "message" => " %{DATA}..." }
```

---

<div class="post-metadata">

**Author:** ![pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pierre](https://discuss.elastic.co/u/pierre)\
**Post date:** [December 6, 2016, 6:53pm UTC](https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149/3 "2016-12-06T18:53:40Z")

</div>

my configuration , but in kibana nothing 0 match, 0 index pattern .. WHY ?

input {  
file {  
start\_position =\> "beginning"  
path =\> "/var/log/firewall/test.log"

}  
}

filter {  
grok {  
break\_on\_match =\> "false"  
match =\> { "message" =\> '%{DATA}%{TIMESTAMP\_ISO8601:Date} %{DATA}source-address="%{IP:ip\_source\_address}"%{DATA}source-port="%{NUMBER:source\_port}"%{DATA}destination-address="%{IP:ip\_destination\_address}"%{DATA}destination-port="%{NUMBER:destination\_port}"%{DATA}service-name="%{WORD:service\_name}" %{DATA} protocol-id="%{NUMBER:protocol\_id}" policy-name="%{DATA:policy\_name}"%{DATA}source-zone-name="%{DATA:source\_zone\_name}"%{DATA}'}

}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
}  
}

location of my log :

ls -ls /var/log/firewall/test.log  
4 -rw-rw----. 1 logstash logstash 44 6 dÃ©c. 21:10 /var/log/firewall/test.log

---

<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:** [December 6, 2016, 8:49pm UTC](https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149/4 "2016-12-06T20:49:26Z")

</div>

Probably because Logstash is tailing test.log. `start_position => "beginning"` only matters for new files. Delete the sincedb file or set `sincedb_path => "/dev/null"`. This exact problem is discussed here every week.

---

<div class="post-metadata">

**Author:** ![pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pierre](https://discuss.elastic.co/u/pierre)\
**Post date:** [December 6, 2016, 9:53pm UTC](https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149/5 "2016-12-06T21:53:40Z")

</div>

with this nothing ...

input {  
file {  
start\_position =\> "beginning"  
path =\> "/var/log/firewall/test.log"  
sincedb\_path =\> "/dev/null"  
}  
}  
with a new file nothing ...

input {  
file {  
start\_position =\> "beginning"  
path =\> "/var/log/firewall/test.log"  
}  
}  
serious i don't understand

---

<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:** [December 7, 2016, 6:36am UTC](https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149/6 "2016-12-07T06:36:48Z")

</div>

Does the logstash user have access to the /var/log/firewall directory? Check your Logstash log for clues. You probably have to turn up the log level at least one notch.

---

<div class="post-metadata">

**Author:** ![pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pierre](https://discuss.elastic.co/u/pierre)\
**Post date:** [December 15, 2016, 12:08pm UTC](https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149/7 "2016-12-15T12:08:07Z")

</div>

without sincedb\_path =\> "/dev/null" it's good with no match

---

<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:** [January 12, 2017, 12:08pm UTC](https://discuss.elastic.co/t/probleme-with-grock-logstash-5-0/68149/8 "2017-01-12T12:08:32Z")

</div>

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