Ad Widget

Collapse

Parse data from json file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ivan_G
    Junior Member
    • Jan 2019
    • 1

    #1

    Parse data from json file

    Hi everybody,

    I want to understand how to parse data from .json file. For example I have the following .json file content taken from netflow web application:

    Code:
    [{"bytes":2934347410,"avgBitsPerSecond":6520772,"flows":11,"packets":2771018,"avgFlowsPerSecond":0.004,"endpointA":{"ip":"10.198.134.6","port":60096},"endpointB":{"ip":"10.149.48.113","port":34750},"application":{"id":542,"name":"UDP","classification":"Networking","category":"General","risk":1}}]
    JQuery returns the below output:

    Code:
    # jq . 1.json
    [
      {
        "application": {
          "risk": 1,
          "category": "General",
          "classification": "Networking",
          "name": "UDP",
          "id": 542
        },
        "endpointB": {
          "port": 34750,
          "ip": "10.149.48.113"
        },
        "endpointA": {
          "port": 60096,
          "ip": "10.198.134.6"
        },
        "avgFlowsPerSecond": 0.004,
        "packets": 2771018,
        "flows": 11,
        "avgBitsPerSecond": 6520772,
        "bytes": 2934347410
      }
    ]
    This actually shows the traffic between EndpointA and EndpointB by protocol/port
    My question is how to parse the data to get graphed data like:

    EndpointA:10.198.134.6 <->EndpointB:10.149.48.113 - value in bytes 2934347410

    Thanks in advance for any reply.
  • jad.baz
    Junior Member
    • Dec 2019
    • 13

    #2
    I'm also trying to see if I can parse JSON from log files. Any update on this?

    Comment

    Working...