JSON Parsing Error


Author
Message
Brad Konia
Brad Konia
Forum Expert (806 reputation)Forum Expert (806 reputation)Forum Expert (806 reputation)Forum Expert (806 reputation)Forum Expert (806 reputation)Forum Expert (806 reputation)Forum Expert (806 reputation)Forum Expert (806 reputation)Forum Expert (806 reputation)
Group: Forum Members
Posts: 70, Visits: 111
Just sent you an error report generated by LVP when it failed to parse my JSON file.

I'm guessing the parsing error is happening beause one of the JSON properties contains encoded JSON, which is somehow confusing the parser. The encoded JSON is properly escaped, so it really should be handled the same as any other string value.

By the way, the reason I'm encoding JSON in a JSON object property is beause I need to log an API response that's sent as JSON. Unfortuntaely, your JSON parser only supports primitives, which kind of defeats the purpose of using JSON. Ideally, I could take the API response and store it as a proper JSON object within a property, instead of having to encode it to a string.
Reply
LogViewPlus Support
LogViewPlus Support
Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)
Group: Moderators
Posts: 1.2K, Visits: 4.3K
Thanks Brad.  I have had a look at the bug report and there is nothing wrong with the JSON line that failed.  This is unfortunate as it is going to make the issue harder to track down.  The issue seems to be with the prior line.

What's happening here is that LogViewPlus needs to determine when a full JSON log entry has been read (keeping in mind that JSON may span multiple lines in the log file).  This is done prior to JSON parsing.  In this case, it is receiving a line of perfectly formatted JSON which cannot be parsed correctly because apparently something in the prior line has confused the pre-scan.

We have made a lot of JSON changes in this release and plan to make a lot more in the next release.  However, in this case, I think this issue would have existed in prior versions as well.  There seem to be something in the file, prior to this log line, which is causing the invalid parse.

I realize this is not always possible, but if you are able to contact me via email and send me the log file I can probably get this turned around very quickly.  Regardless, I will take a closer look at the pre-scan code to see if I can determine where the error might be.

Also - it is only the parser definition that must work with JSON primitives.  This is because the conversion specifier is is a string.  There should be no issue with using a conversion specifier to store a JSON object.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
SoBeGuy - 4 Years Ago
LogViewPlus Support - 4 Years Ago
SoBeGuy - 4 Years Ago
SoBeGuy - 4 Years Ago
LogViewPlus Support - 4 Years Ago
SoBeGuy - 4 Years Ago
LogViewPlus Support - 4 Years Ago
SoBeGuy - 4 Years Ago
LogViewPlus Support - 4 Years Ago
SoBeGuy - 4 Years Ago
av2408 - 3 Years Ago
LogViewPlus Support - 3 Years Ago
av2408 - 3 Years Ago
LogViewPlus Support - 3 Years Ago
av2408 - 3 Years Ago
LogViewPlus Support - 3 Years Ago
                     I've got answer to all my questions. Waiting for BETA.
av2408 - 3 Years Ago
                         Hi AV, I investigated this issue today and it is going to be more...
LogViewPlus Support - 3 Years Ago
av2408 - 3 Years Ago

Similar Topics

Login

Explore
Messages
Mentions
Search