Skip to content
Advertisement

JSON formation from a JSON data

I have the JSON data below. I need the JSON to split and form a new JSON data object. I’m new to this and am struggling to get a way to solve this.

below JSON data:

JavaScript

This has to be done for all the session_id values in the input JSON data. It has to form all the JSON data to iterate and show in another HTML. I’m confused here and aim to get the following: Sample output:

JavaScript

I need to get a result like above for all session_id values.

Advertisement

Answer

You have a concept-level problem. A session may have multiple threads for separate requests and therefore you need to support a one-to-many relationship for session-request/thread. So, my solution is not exactly looking like your sample output, because there are multiple threads, each having their own label:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement