# Grook Format For APM Nginx Log

**URL:** https://discuss.elastic.co/t/grook-format-for-apm-nginx-log/265439
**Category:** Logstash
**Created:** [February 25, 2021, 6:36am UTC](https://discuss.elastic.co/t/grook-format-for-apm-nginx-log/265439 "2021-02-25T06:36:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![reza\_naipospos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reza_naipospos/32/76767_2.png) [@reza\_naipospos](https://discuss.elastic.co/u/reza_naipospos)
#### Post date: [February 25, 2021, 6:36am UTC](https://discuss.elastic.co/t/grook-format-for-apm-nginx-log/265439/1 "2021-02-25T06:36:16Z")

</div>

i have format log like this, how logstash can make new field on elasticsearch for every this log, currently all log is in message field.

timestamp="25/Feb/2021:13:34:22 +0700" client=192.168.0.21 request="GET /api/Supir/Browse/JUMALI%20SIREGAR HTTP/1.0" request\_length=1219 bytes\_sent=296 body\_bytes\_sent=84 referer=https://sample.domain.com/ user\_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36" upstream\_addr=127.0.0.1:5000 upstream\_status=200 request\_time=0.175 upstream\_response\_time=0.176 upstream\_connect\_time=0.001 upstream\_header\_time=0.176

---

<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: [February 25, 2021, 4:38pm UTC](https://discuss.elastic.co/t/grook-format-for-apm-nginx-log/265439/2 "2021-02-25T16:38:36Z")

</div>

Use a [kv](https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html) filter. If there is a header on the line then remove it using [dissect](https://discuss.elastic.co/t/parsing-firewall-logs-in-logstash/212786/2).

---

<div class="post-metadata">

### Author: ![reza\_naipospos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reza_naipospos/32/76767_2.png) [@reza\_naipospos](https://discuss.elastic.co/u/reza_naipospos)
#### Post date: [February 26, 2021, 4:25am UTC](https://discuss.elastic.co/t/grook-format-for-apm-nginx-log/265439/3 "2021-02-26T04:25:40Z")

</div>

thanks , i will try it

---

<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: [March 26, 2021, 4:25am UTC](https://discuss.elastic.co/t/grook-format-for-apm-nginx-log/265439/4 "2021-03-26T04:25:57Z")

</div>

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