# JSON Filter target doesn't work

**URL:** <https://discuss.elastic.co/t/json-filter-target-doesnt-work/84008>\
**Category:** Logstash\
**Created:** [April 28, 2017, 12:02pm UTC](https://discuss.elastic.co/t/json-filter-target-doesnt-work/84008 "2017-04-28T12:02:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreAga](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@AndreAga](https://discuss.elastic.co/u/AndreAga)\
**Post date:** [April 28, 2017, 12:02pm UTC](https://discuss.elastic.co/t/json-filter-target-doesnt-work/84008/1 "2017-04-28T12:02:23Z")

</div>

Hi,  
this is my Grok + JSON Filter:

```
grok {
	match => { "message" => ".* \| URL: (?<url>[^]*) - Request: (?<request_json>(.|\r|\n)*) - Response: (?<response_json>(.|\r|\n)*)" }
}

if [request_json] != "---" {
	json {
		source => "request_json"
		target => "request"
	}
}

if [response_json] != "---" {
	json {
		source => "response_json"
		target => "response"
	}
}

```

I'm using logstash 5.3, and the result is that if I use the option target the log is not indexed, otherwise, if I comment it, the logs is indexed correctly.

Any suggestion? Thanks.

---

<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:** [May 26, 2017, 12:11pm UTC](https://discuss.elastic.co/t/json-filter-target-doesnt-work/84008/2 "2017-05-26T12:11:59Z")

</div>

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