# Invalid FieldReference issue in logstash

**URL:** https://discuss.elastic.co/t/invalid-fieldreference-issue-in-logstash/194742
**Category:** Logstash
**Created:** [August 11, 2019, 10:49am UTC](https://discuss.elastic.co/t/invalid-fieldreference-issue-in-logstash/194742 "2019-08-11T10:49:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sukku77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukku77/32/52068_2.png) [@sukku77](https://discuss.elastic.co/u/sukku77)
#### Post date: [August 11, 2019, 10:49am UTC](https://discuss.elastic.co/t/invalid-fieldreference-issue-in-logstash/194742/1 "2019-08-11T10:49:08Z")

</div>

Hi All,  
I am getting the below logstash exception stack trace after migrated from 6.5.4 to 7.3.0.  
Does this mean Logstash is dropping out some events? Do I need to update any template to suppress these warnings. There is no other error trace other than the below warning. Can someone please advice on this. Thanks in advance

```
   [2019-08-11T10:02:09,886][WARN][logstash.filters.kv] Exception while parsing KV {:exception=>"Invalid FieldReference: `Actor[akka`"}

```

Regards  
Sukumar C

---

<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: [August 11, 2019, 12:34pm UTC](https://discuss.elastic.co/t/invalid-fieldreference-issue-in-logstash/194742/2 "2019-08-11T12:34:36Z")

</div>

The kv filter adds fields to the event using [event.set](https://github.com/logstash-plugins/logstash-filter-kv/blob/46cfc5001a44ef4676943696e7fa389a8627cbdb/lib/logstash/filters/kv.rb#L429), which means the field name goes through "[sprintf](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#sprintf)" processing. That in turn means that things like

```
{ "bar": "[foo][0]=a [foo][1]=[foo][0] [foo][2]=c"}

```

get parsed into

```
       "foo" => {
    "1" => "[foo][0]",
    "0" => "a",
    "2" => "c"
},

```

but it also means that the field name cannot contain unmatched square brackets.

A workaround would be to use mutate+gsub to change square bracket to some other character. You would need to use a ruby filter if you want to change the field name back after the kv filter.

---

<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 8, 2019, 12:34pm UTC](https://discuss.elastic.co/t/invalid-fieldreference-issue-in-logstash/194742/3 "2019-09-08T12:34:48Z")

</div>

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