# Filter firewall : Fortigat

**URL:** <https://discuss.elastic.co/t/filter-firewall-fortigat/131769>\
**Category:** Logstash\
**Created:** [May 14, 2018, 3:10pm UTC](https://discuss.elastic.co/t/filter-firewall-fortigat/131769 "2018-05-14T15:10:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![asalma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asalma/32/32199_2.png) [@asalma](https://discuss.elastic.co/u/asalma)\
**Post date:** [May 14, 2018, 3:10pm UTC](https://discuss.elastic.co/t/filter-firewall-fortigat/131769/1 "2018-05-14T15:10:39Z")

</div>

Hi,

Please, can someone help me to create a filter grok to separate the fields of logs that came from a Fortigat firewall.

This is an example of log :

May 9 09:40:15 frkeofwglo01 date=2018-05-09 time=09:40:15 devname=frkeofwglo01 devid=FG900D3916800170 logid=0000000013 type=traffic subtype=forward level=notice vd=frkeofwin01 srcip=x.x.x.x srcport=17473 srcintf="INT-PROXYs" dstip=x.x.x.x dstport=443 dstintf="KEO-INT\_DMZ" poluuid=c77d5f40-a592-51e6-c3c6-8cd462826a48 sessionid=4130745007 proto=6 action=close policyid=382 policytype=policy dstcountry="France" srccountry="Reserved" trandisp=noop service="HTTPS" duration=3 sentbyte=1114 rcvdbyte=4013 sentpkt=14 rcvdpkt=12 appcat="unscanned" devtype="Router/NAT Device" mastersrcmac=74:a0:2f:29:e5:06 srcmac=74:a0:2f:29:e5:06

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 14, 2018, 4:37pm UTC](https://discuss.elastic.co/t/filter-firewall-fortigat/131769/2 "2018-05-14T16:37:34Z")

</div>

I would not use grok for that. Use dissect.

```
dissect { mapping => { "message" => "%{ts} %{+ts} %{+ts} %{host} %{restofline}" } }
kv { source => "restofline" }
```

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [May 14, 2018, 4:38pm UTC](https://discuss.elastic.co/t/filter-firewall-fortigat/131769/3 "2018-05-14T16:38:07Z")

</div>

You could use a kv{} filter.

```
kv {
  source => "message",
  seperator => "="
}
```

---

<div class="post-metadata">

**Author:** ![admlko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/admlko/32/21787_2.png) [@admlko](https://discuss.elastic.co/u/admlko)\
**Post date:** [May 14, 2018, 6:00pm UTC](https://discuss.elastic.co/t/filter-firewall-fortigat/131769/4 "2018-05-14T18:00:17Z")

</div>

kv is a no brainer in this case. I also use it for Sonicwall fw log.

---

<div class="post-metadata">

**Author:** ![asalma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asalma/32/32199_2.png) [@asalma](https://discuss.elastic.co/u/asalma)\
**Post date:** [May 15, 2018, 1:45pm UTC](https://discuss.elastic.co/t/filter-firewall-fortigat/131769/5 "2018-05-15T13:45:45Z")

</div>

It works better !!

grok { match =\> { "message" =\> "%{SYSLOGTIMESTAMP:syslog\_timestamp} %{HOSTNAME:hostname} %{GREEDYDATA:source\_data}"}}

kv { source =\> "data" }

---

<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 12, 2018, 1:45pm UTC](https://discuss.elastic.co/t/filter-firewall-fortigat/131769/6 "2018-06-12T13:45:59Z")

</div>

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