# Detected ambiguous Field Reference. How to fix it exactly?

**URL:** <https://discuss.elastic.co/t/detected-ambiguous-field-reference-how-to-fix-it-exactly/175076>\
**Category:** Logstash\
**Created:** [April 2, 2019, 9:21pm UTC](https://discuss.elastic.co/t/detected-ambiguous-field-reference-how-to-fix-it-exactly/175076 "2019-04-02T21:21:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcaballero](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jcaballero](https://discuss.elastic.co/u/jcaballero)\
**Post date:** [April 2, 2019, 9:21pm UTC](https://discuss.elastic.co/t/detected-ambiguous-field-reference-how-to-fix-it-exactly/175076/1 "2019-04-02T21:21:04Z")

</div>

Hi

LogStash 6.6.2

I see several topics with similar questions, but answers are unclear to me. So I ask again.  
In my filters, I have this

```
mutate { add_field => { "executionhost" => "%{host[name]}" } }

mutate {
    split => ["source", "/"]
    add_field => { "logfile" => "%{source[-1]}" }
}

```

It works fine, JSON output includes the hostname and the log filename.  
However, it triggers these 2 warning messages:

```
[WARN] 2019-04-02 11:38:55.217 [[main]>worker0] FieldReference - Detected ambiguous Field Reference `host[name]`, which we expanded to the path `[host, name]`; in a future release of Logstash, ambiguous Field References will not be expanded.

[WARN] 2019-04-02 11:38:55.255 [[main]>worker0] FieldReference - Detected ambiguous Field Reference `source[-1]`, which we expanded to the path `[source, -1]`; in a future release of Logstash, ambiguous Field References will not be expanded.

```

If I change, for example the first one, like this:

```
mutate { add_field => { "executionhost" => "[host, name]" } }

```

Only thing I get in the json output is this:

```
"executionhost" => "[host, name]",

```

So, must I change the original code? If yes, how exactly?

Cheers,  
Jose

---

<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:** [April 2, 2019, 9:26pm UTC](https://discuss.elastic.co/t/detected-ambiguous-field-reference-how-to-fix-it-exactly/175076/2 "2019-04-02T21:26:30Z")

</div>

If host is an object that contains a nested object called name then

```
mutate { add_field => { "executionhost" => "%{[host][name]}" } }
```

---

<div class="post-metadata">

**Author:** ![jcaballero](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jcaballero](https://discuss.elastic.co/u/jcaballero)\
**Post date:** [April 2, 2019, 9:33pm UTC](https://discuss.elastic.co/t/detected-ambiguous-field-reference-how-to-fix-it-exactly/175076/3 "2019-04-02T21:33:55Z")

</div>

Perfect!!  
Thanks a lot.

---

<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:** [April 30, 2019, 9:33pm UTC](https://discuss.elastic.co/t/detected-ambiguous-field-reference-how-to-fix-it-exactly/175076/4 "2019-04-30T21:33:58Z")

</div>

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