JSON Parsing Error


Author
Message
Andrii Vdovenko
Andrii Vdovenko
Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)
Group: Forum Members
Posts: 14, Visits: 50
Hello.
I tried the method Brad provided.
It works fine on my side.
But, entire JSON object still parsed as a text message and placed in a one column.
 May I let LogViewPlus to create columns based on json key-value-pairs like on screenshot attached?

Thank you.
Andrii
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Hi Andrii,

Try right clicking on the message and selecting Parse Message:


This doesn't explicitly parse the JSON, but it should get you most of the way there.  Alternatively, you can try modifying your parser configuration to provide more detail.

Hope that helps,

Toby
Edited 2 Years Ago by LogViewPlus Support
Andrii Vdovenko
Andrii Vdovenko
Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)
Group: Forum Members
Posts: 14, Visits: 50
Clarification about the question above: may LogViewPlus automatically detect key-value-pairs ? I mean variable number of key-value-pairs of variable types, without a pre-defined set of exact keys/columns?
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
We are actively working on making this happen.  The Parse Message command outlined above represents our current best efforts on this approach.  The next BETA release due out early next week will further enhance our message parsing capabilities.  

Unfortunately, I had a look at our Parse Message unit tests in JSON scenarios and I don't think this is going to work for you at the moment.  We currently treat the JSON as one block - which would not be an improvement for you.  Let me take a look and see if we can improve things for the next BETA release.
Andrii Vdovenko
Andrii Vdovenko
Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)
Group: Forum Members
Posts: 14, Visits: 50
"Parse message" do not extract columns (
Here is the video:

Can I extract columns from json without creating custom parser in C#?
Can I extract columns from json by creating custom parser in C#? Will you help me? )

LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Please see my comment above.  I will take a look at this for the next BETA release.

This is the only way to parse these fields without creating a custom parser.  I can help you with specific questions about LogViewPlus, including creating custom parsers, but I cannot help you create a custom parser.
Andrii Vdovenko
Andrii Vdovenko
Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)
Group: Forum Members
Posts: 14, Visits: 50
Thanks a lot.
You are posting answers faster than I am completing questions ) This is amazing responsiveness, thank you.
Just for case, this is the link on the video: Parsing json in message

The question is still actual: can I achieve my result by creating custom parser?

Just for case, if this my be helpful for your team, here is my case;
i am generating logs from custom script for .Net application (NinjaTrader) with the help of Newtonsoft json converter and saving them to file using NLog.

And I need to send very different objects each time.

Thanks again. I am looking forward for BETA.
Andrii Vdovenko
Andrii Vdovenko
Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)Junior Member (56 reputation)
Group: Forum Members
Posts: 14, Visits: 50
I've got answer to all my questions.
Waiting for BETA.
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Hi AV,

I investigated this issue today and it is going to be more difficult to resolve than I initially expected.  We will not be able to produce a solution in the short term.

There are two main problems that we have at the moment.
1. The Parse Message command wants to identify other, similar messages in the log file.  Dealing with a variable like 'JSON' is too ambiguous.  For example, if multiple messages have a lot of differentiation, what would the column headings be?
2. There is a performance impact to parsing JSON (mainly from a memory perspective).  LogViewPlus processes messages when the file is parsed.  Right now, we don't to take the performance hit of parsing JSON unless we know the user was going to need this feature.

This is absolutely something that we will be investigating and adding in the future - it is just not something that we can quickly fix.

For the moment, the best solution I can suggest is to:
1. Manually identify the messages in the log file which are similar.
2. Export those log entries to a new log file.
3. Open the newly created log file.  Create a new parser configuration as needed.

You mentioned "very different objects each time".  Because of this, I don't think you will be able to easily solve your problem with a custom parser.  All LogViewPlus parsers require a conformity with the logging format.  If you have a lot of variability in your messages, this is going to be difficult.  Again - what would your column headers be?  Also, if your messages were more uniform, you wouldn't need a customer parser - the existing JSON parser would probably work fine.

Hope that helps,

Toby

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search