Problem with parsing in logstash

(NIloufar) #1

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:
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?

(Magnus Bäck) #2

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

(NIloufar) #3

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 ",".

(Magnus Bäck) #4

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.

(NIloufar) #5

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

(Magnus Bäck) #6

Have you read the Elasticsearch documentation on index templates?

(NIloufar) #7

yes but there isn't any input templates for mongoDB

(Magnus Bäck) #8

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.

(NIloufar) #9

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

(system) #10

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