# Grok Filter help needed with Suricata Logs

**URL:** <https://discuss.elastic.co/t/grok-filter-help-needed-with-suricata-logs/90727>\
**Category:** Logstash\
**Created:** [June 24, 2017, 9:39pm UTC](https://discuss.elastic.co/t/grok-filter-help-needed-with-suricata-logs/90727 "2017-06-24T21:39:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malik\_Mazhar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/malik_mazhar/32/19499_2.png) [@Malik\_Mazhar](https://discuss.elastic.co/u/Malik_Mazhar)\
**Post date:** [June 24, 2017, 9:39pm UTC](https://discuss.elastic.co/t/grok-filter-help-needed-with-suricata-logs/90727/1 "2017-06-24T21:39:15Z")

</div>

Hi Guys, i am trying to sort my Suricata logs on pfsense, got it working but one issue i cant seperate Priority from the number and proto from the {}.. below is the sample log need your help.

[1:2210045:2] SURICATA STREAM Packet with invalid ack [Classification: Generic Protocol Command Decode] [Priority: 3]: {TCP} 111.2.1.1:24999 -\> 5.21.229.226:443

The best i could come up with .. Grok Debugger  
%{SYSLOG5424SD:evenID} %{CISCO\_REASON:Suricata\_Trigger} %{SYSLOG5424SD:Classification} %{SYSLOG5424SD}: %{NOTSPACE:service} %{NOTSPACE:proto} %{NOTSPACE:Destination\_ip}:%{INT:destination\_port} %{NOTSPACE} %{NOTSPACE:Source\_ip}:%{INT:Source\_port}

The issue is below, i cant seperate Priority and number.  
%{SYSLOG5424SD}:  
"[Priority: 3]"  
how to separate Protocol from {}  
"proto":  
"{TCP}"

---

<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:** [June 26, 2017, 1:05pm UTC](https://discuss.elastic.co/t/grok-filter-help-needed-with-suricata-logs/90727/2 "2017-06-26T13:05:42Z")

</div>

You mean you want `proto` to contain "TCP" instead of "{TCP}" and `service` to contain "3" instead of "[Priority: 3]"? To avoid misunderstandings an example of what you have and what you want to get would help.

---

<div class="post-metadata">

**Author:** ![Malik\_Mazhar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/malik_mazhar/32/19499_2.png) [@Malik\_Mazhar](https://discuss.elastic.co/u/Malik_Mazhar)\
**Post date:** [June 27, 2017, 10:52pm UTC](https://discuss.elastic.co/t/grok-filter-help-needed-with-suricata-logs/90727/3 "2017-06-27T22:52:14Z")

</div>

Yes sir you are right, i want TCP without curly brasses {} and 3 instead of Priority : 3 ....

this is my suricata Log example from PFSense Firewall. i sorted out everything via grok filter but dont know how to remove brasses from protocol and Priority from the numeric number for example 3.

[1:2210045:2] SURICATA STREAM Packet with invalid ack [Classification: Generic Protocol Command Decode] [Priority: 3]: {TCP} 111.2.1.1:24999 -\> 5.21.229.226:443

---

<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:** [June 28, 2017, 5:47am UTC](https://discuss.elastic.co/t/grok-filter-help-needed-with-suricata-logs/90727/4 "2017-06-28T05:47:46Z")

</div>

Replace

```
%{NOTSPACE:service} %{NOTSPACE:proto}

```

with

```
\[Priority: %{NUMBER:service}\] \{%{WORD:proto}\}
```

---

<div class="post-metadata">

**Author:** ![Malik\_Mazhar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/malik_mazhar/32/19499_2.png) [@Malik\_Mazhar](https://discuss.elastic.co/u/Malik_Mazhar)\
**Post date:** [July 3, 2017, 5:46am UTC](https://discuss.elastic.co/t/grok-filter-help-needed-with-suricata-logs/90727/5 "2017-07-03T05:46:39Z")

</div>

Thanks a Million Magnusbaeck ... worked well with some tweaking 🙂

[Priority: 3]  
[%{NOTSPACE:Priority}: %{NOTSPACE:Priority\_Number}]

---

<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 31, 2017, 5:46am UTC](https://discuss.elastic.co/t/grok-filter-help-needed-with-suricata-logs/90727/6 "2017-07-31T05:46:58Z")

</div>

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