The goal is to extract fields from JSON data and represent the data in a tabular format.
Here, the idea is to display the “Count of live Players” GROUPED BY `mode`. So let’s start searching!
NOTE: Using "\" is very important before any special characters.
PROBLEM PERSISTS: As you can see, the key is a combination of mode & values which is not as per our expectations.
So, let’s try and tackle this with a few commands that come in handy to handle these kinds of problems
Note: As per our expectations, desired values are already present as field values in the table. The only thing remaining is to assign these values to the proper `mode` field.
Use `untable` command to make a horizontal data set.
Once we get this, we can create a field from the values in the `column` field. Don’t be afraid of “| eval {Column}=Value”. This is just a magical move called dynamic eval. <>
You can see the new fields count, label and peak24. Now we have all the required fields but in different rows.
You can see the new fields count, label and peak24. Now we have all the required fields but in different rows.
You can use this technique in any JSON data similar to sample JSON event and display data in a tabular format.
Sein Tun is a Software Engineer working at Crest Data Systems. He has varied software development experience utilizing modern technologies and frameworks like React, Redux, Node.js, JavaScript, Python, and Golang to build secure high-performance systems. Before joining Crest, Sein worked as Financial Banker and Assistant Manager for 3 years with JPMorgan Chase Bank excelling in customer experience, compliance, and team management. He is a proud alumnus of the University of California Riverside with a Bachelor of Science in Management Information System. He enjoys building applications that improve and make a difference in people’s lifestyles.