xros / jsonpyes

The tool which imports raw JSON to ElasticSearch in one line of commands
Other
67 stars 21 forks source link

JSON data not valid with error #20

Open tdyhacker opened 8 years ago

tdyhacker commented 8 years ago

I use mysql workbench export data to json file,when I use jsonpyes to import the json file,it display some error:

JSON data not valid with error
 Expecting value: line 2 column 1 (char 69)

my json file:

[{"id":"10155", "username":"", "password":""},
 {"id":"10156", "username":"", "password":""},
 {"id":"10157", "username":"", "password":""},
 {"id":"10158", "username":"", "password":""},
 {"id":"10159", "username":"", "password":""},
 {"id":"10160", "username":"", "password":""},
 {"id":"10161", "username":"", "password":""},
 {"id":"10162", "username":"", "password":""},

I don't know how the stand json file should be?

xros commented 8 years ago

@tdyhacker hey, actually the JSON file you got should be without symbol "[" and without "," at the end

The valid format for your scenario could be like this.

 {"id":"10155", "username":"", "password":""}
 {"id":"10156", "username":"", "password":""}
 {"id":"10157", "username":"", "password":""}
 {"id":"10158", "username":"", "password":""}
 {"id":"10159", "username":"", "password":""}
 {"id":"10160", "username":"", "password":""}
 {"id":"10161", "username":"", "password":""}
 {"id":"10162", "username":"", "password":""}

Feel free to contact me

xros commented 8 years ago

@tdyhacker And you can check this file https://github.com/xros/jsonpyes/blob/master/raw_data.json for instance. This is a valid JSON file shipped with jsonpyes.