# Object mapping errors

**URL:** https://discuss.elastic.co/t/object-mapping-errors/290032
**Category:** Logstash
**Created:** [November 24, 2021, 9:25am UTC](https://discuss.elastic.co/t/object-mapping-errors/290032 "2021-11-24T09:25:19Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [November 24, 2021, 5:45pm UTC](https://discuss.elastic.co/t/object-mapping-errors/290032/2 "2021-11-24T17:45:55Z")

</div>

> "mapper\_parsing\_exception", "reason"=\>"object mapping for [file] tried to parse field [file] as object, but found a concrete value"}

That is saying that the event has a [file] field that is a string (or number, or date, or whatever)

```
"file"=>"InitMDCRequestFilter.java"

```

but elasticsearch expects it to be an object with fields nested inside it. A field on a document cannot be a string on some documents and an object on others.

You will have to modify the event to match what elasticsearch expects. That might be as simple as

```
mutate { rename => { "[file]" => "[file][name]" } }

```

or if on some events it is a string and on others an object you might need a conditional test

```
if ! [file][name] { ... }

```

or even use ruby to test `if event.get("file").is_a? String`

---

_[View the full topic](https://discuss.elastic.co/t/object-mapping-errors/290032)._
