# Problem with parsing in logstash

**URL:** <https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319>\
**Category:** Logstash\
**Created:** [July 10, 2018, 10:04am UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319 "2018-07-10T10:04:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![NIloufarVafaei](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@NIloufarVafaei](https://discuss.elastic.co/u/NIloufarVafaei)\
**Post date:** [July 10, 2018, 10:04am UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/1 "2018-07-10T10:04:36Z")

</div>

hello  
i try to pars json data that has string data which one of these json data just has one string line like : 021965425836  
and another one has string line that separate with "," look like this:  
0201923165000,0202000415001,0202302800000  
the problem is logstash cannot pars each json data that separate with "," and give back this error  
rror"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse [deposit]", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"For input string: "0201923165000,0202000415001,0202302800000""}}}}}  
how can i fix that?

---

<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:** [July 10, 2018, 5:55pm UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/2 "2018-07-10T17:55:08Z")

</div>

How should this data be represented in ES? Do you really want to store it as a string of comma-separated sequences of digits?

---

<div class="post-metadata">

**Author:** ![NIloufarVafaei](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@NIloufarVafaei](https://discuss.elastic.co/u/NIloufarVafaei)\
**Post date:** [July 11, 2018, 3:19am UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/3 "2018-07-11T03:19:54Z")

</div>

> [@magnusbaeck](#):
>
> digits

actually these data are part of mongodb collection and these digits are part of json data that store in mongodb collection so i have to separate them with ",".

---

<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:** [July 11, 2018, 12:04pm UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/4 "2018-07-11T12:04:14Z")

</div>

I'm not sure that really answers my question, but the problem is probably that the `deposit` field has been mapped as an integer and an integer field can't store "0201923165000,0202000415001,0202302800000". You can use an index template to force the mapping of the `deposit` field to be a string. You'll have to reindex the data.

---

<div class="post-metadata">

**Author:** ![NIloufarVafaei](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@NIloufarVafaei](https://discuss.elastic.co/u/NIloufarVafaei)\
**Post date:** [July 14, 2018, 5:20am UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/5 "2018-07-14T05:20:17Z")

</div>

could you give me some example of "index template"?

---

<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:** [July 14, 2018, 6:00pm UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/6 "2018-07-14T18:00:47Z")

</div>

Have you read the Elasticsearch documentation on index templates?

---

<div class="post-metadata">

**Author:** ![NIloufarVafaei](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@NIloufarVafaei](https://discuss.elastic.co/u/NIloufarVafaei)\
**Post date:** [July 15, 2018, 8:36am UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/7 "2018-07-15T08:36:08Z")

</div>

yes but there isn't any input templates for mongoDB

---

<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:** [July 15, 2018, 6:40pm UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/8 "2018-07-15T18:40:58Z")

</div>

You're looking for the wrong thing. Index templates configure, among other things, the fields, their data types, and other indexing-related properties. From where your data originates has absolutely nothing to do with any of that.

---

<div class="post-metadata">

**Author:** ![NIloufarVafaei](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@NIloufarVafaei](https://discuss.elastic.co/u/NIloufarVafaei)\
**Post date:** [July 16, 2018, 3:30am UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/9 "2018-07-16T03:30:59Z")

</div>

could you send me some links ? and i am really appreciated for your response.

---

<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:** [August 13, 2018, 3:31am UTC](https://discuss.elastic.co/t/problem-with-parsing-in-logstash/139319/10 "2018-08-13T03:31:02Z")

</div>

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