# Wrong Syntax

**URL:** <https://discuss.elastic.co/t/wrong-syntax/96118>\
**Category:** Logstash\
**Created:** [August 7, 2017, 1:58pm UTC](https://discuss.elastic.co/t/wrong-syntax/96118 "2017-08-07T13:58:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssasporta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssasporta/32/13695_2.png) [@ssasporta](https://discuss.elastic.co/u/ssasporta)\
**Post date:** [August 7, 2017, 1:58pm UTC](https://discuss.elastic.co/t/wrong-syntax/96118/1 "2017-08-07T13:58:48Z")

</div>

My Filter in Logstash looks like that:

```
     } else if "issuer" in [jsonstring] {
                               mutate { add_field => ["issuer", "%{[jsonstring][issuer]}" ] }

```

**I am getting the following in Kibana:**

![Wrong Syntax in filter](https://us1.discourse-cdn.com/elastic/original/3X/c/4/c45125ae59012e15816a2c8089bfc1fa1e5b8d79.png)

What is wrong with my syntax? Why I am not getting in the issuer field the value "r"?

Thanks  
Sharon.

---

<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:** [August 7, 2017, 2:31pm UTC](https://discuss.elastic.co/t/wrong-syntax/96118/2 "2017-08-07T14:31:15Z")

</div>

`[jsonstring][issuer]` means "the field `jsonstring` with the subfield `issuer`", i.e. a JSON document that looks like this:

```nohighlight
{
  ...
  "jsonstring": {
    "issuer": "..."
  }
}

```

That's not what you have. You have a `jsonstring` field containing the string "issuer=r". I suggest you use a kv filter to parse that string and create the `issuer` field.

---

<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:** [September 4, 2017, 2:31pm UTC](https://discuss.elastic.co/t/wrong-syntax/96118/3 "2017-09-04T14:31:34Z")

</div>

Closed on September 4, 2017, 2:31pm UTC

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