# Regarding automapping for json file

**URL:** <https://discuss.elastic.co/t/regarding-automapping-for-json-file/188109>\
**Category:** Logstash\
**Created:** [June 28, 2019, 10:07pm UTC](https://discuss.elastic.co/t/regarding-automapping-for-json-file/188109 "2019-06-28T22:07:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![leeyu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leeyu/32/48561_2.png) [@leeyu](https://discuss.elastic.co/u/leeyu)\
**Post date:** [June 28, 2019, 10:07pm UTC](https://discuss.elastic.co/t/regarding-automapping-for-json-file/188109/1 "2019-06-28T22:07:01Z")

</div>

Hi, all

Is there any way to disable json's automapping?

I tried to use the template to disable the numeric detection but it does not work.

Since my data has many fields, it does not make sense to change type for each field manually.

Thanks.

---

<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:** [June 28, 2019, 10:12pm UTC](https://discuss.elastic.co/t/regarding-automapping-for-json-file/188109/2 "2019-06-28T22:12:13Z")

</div>

Are you saying that you want the JSON to be parsed but everything converted to strings?

---

<div class="post-metadata">

**Author:** ![leeyu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leeyu/32/48561_2.png) [@leeyu](https://discuss.elastic.co/u/leeyu)\
**Post date:** [June 28, 2019, 10:32pm UTC](https://discuss.elastic.co/t/regarding-automapping-for-json-file/188109/3 "2019-06-28T22:32:10Z")

</div>

Hi Badger,

Thanks for the reply.

Yes. I only need one value to be long and the rest to be strings.

So I want to disable the auto mapping.

Here is my logstash input plugin

```
input {
    file {
        path => "/data/Aggregation_json/all_aggregation.json"
        codec => json
        start_position => "beginning"
        sincedb_path => "/dev/null"
    }   
}
```

---

<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:** [June 28, 2019, 10:46pm UTC](https://discuss.elastic.co/t/regarding-automapping-for-json-file/188109/4 "2019-06-28T22:46:49Z")

</div>

You cannot disable it, but you can iterate over the event in a ruby filter and .to\_s everything.

---

<div class="post-metadata">

**Author:** ![leeyu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leeyu/32/48561_2.png) [@leeyu](https://discuss.elastic.co/u/leeyu)\
**Post date:** [June 28, 2019, 10:54pm UTC](https://discuss.elastic.co/t/regarding-automapping-for-json-file/188109/5 "2019-06-28T22:54:12Z")

</div>

Thanks a lot, I will try it.

---

<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:** [June 28, 2019, 11:52pm UTC](https://discuss.elastic.co/t/regarding-automapping-for-json-file/188109/6 "2019-06-28T23:52:22Z")

</div>

[This](https://discuss.elastic.co/t/lowercase-all-fields-and-sub-fields/174438/2) might help you understand how to iterate over arbitrary event structures. It solves a different problem (making all keys and values lowercase) but making all values strings is similar enough for it to be useful.

---

<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:** [July 26, 2019, 11:52pm UTC](https://discuss.elastic.co/t/regarding-automapping-for-json-file/188109/7 "2019-07-26T23:52:34Z")

</div>

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