Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when json output is configured, print in json format #57

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

amohit1315
Copy link
Collaborator

when json output is configured, print in json format

#50

@amohit1315 amohit1315 merged commit d6fccff into master Oct 18, 2024
@chagantvj
Copy link

./jtimon-linux-amd64-latest --version
2024/10/29 19:18:27 Version: v2.0.4-75d77de34e28e98d742c102ea530504432eec489-master BuildTime 2024-10-29T16:52:08+0530

Usage: ./jtimon-linux-amd64-latest --config Ngpr-brackla-1-grpc-auth_log.json --no-per-packet-goroutines --json

  {
    "elems": [
      "state", <---- this should be printed as state/text as these two elements are not at same level.
      "text"
    ],
    "key": "string_val",
    "value": "Static Mpls lsp(280) usage requires a license"
  },
  {
    "elems": [
      "state", <---- like "state/time-created"
      "time-created"
    ],
    "key": "uint_val",
    "value": "1730229150000000000"
  },
  {
    "elems": [
      "state",
      "severity"
    ],
    "key": "string_val",
    "value": "MINOR"
  },
  {
    "elems": [
      "state",
      "type-id"
    ],
    "key": "string_val",
    "value": "License"
  }
]

},

------------------- OUTPUT -------------

{
"component": "re0/alarmd",
"component_id": "65535",
"export_timestamp": "1730229390350",
"notification": {
"del_paths": null,
"prefix": "/system/alarms/alarm",
"timestamp": 1730229390350469769,
"updates": [
{
"elems": [
"state",
"resource"
],
"key": "string_val",
"value": "SYSTEM"
},
{
"elems": [
"state",
"text"
],
"key": "string_val",
"value": "2960 Port Bandwidth Usage (in gbps)s(279) require a license"
},
{
"elems": [
"state",
"time-created"
],
"key": "uint_val",
"value": "1730229390000000000"
},
{
"elems": [
"state",
"severity"
],
"key": "string_val",
"value": "MINOR"
},
{
"elems": [
"state",
"type-id"
],
"key": "string_val",
"value": "License"
}
]
},
"sensor_name": "sensor_1038",
"sequence_number": "104155",
"streamed_path": "/system/alarms/",
"subscribed_path": "/system/alarms/",
"system_id": "ngpr-brackla-1a"
}
{
"component": "re0/alarmd",
"component_id": "65535",
"export_timestamp": "1730229390350",
"notification": {
"del_paths": null,
"prefix": "/system/alarms/alarm",
"timestamp": 1730229390350712985,
"updates": [
{
"elems": [
"state",
"resource"
],
"key": "string_val",
"value": "SYSTEM"
},
{
"elems": [
"state",
"text"
],
"key": "string_val",
"value": "Static Mpls lsp(280) usage requires a license"
},
{
"elems": [
"state",
"time-created"
],
"key": "uint_val",
"value": "1730229330000000000"
},
{
"elems": [
"state",
"severity"
],
"key": "string_val",
"value": "MINOR"
},
{
"elems": [
"state",
"type-id"
],
"key": "string_val",
"value": "License"
}
]
},
"sensor_name": "sensor_1038",
"sequence_number": "104156",
"streamed_path": "/system/alarms/",
"subscribed_path": "/system/alarms/",
"system_id": "ngpr-brackla-1a"
}
{
"component": "re0/alarmd",
"component_id": "65535",
"export_timestamp": "1730229390351",
"notification": {
"del_paths": null,
"prefix": "/system/alarms/alarm",
"timestamp": 1730229390350908698,
"updates": [
{
"elems": [
"state",
"resource"
],
"key": "string_val",
"value": "SYSTEM"
},
{
"elems": [
"state",
"text"
],
"key": "string_val",
"value": "Static Mpls lsp(280) usage requires a license"
},
{
"elems": [
"state",
"time-created"
],
"key": "uint_val",
"value": "1730229390000000000"
},
{
"elems": [
"state",
"severity"
],
"key": "string_val",
"value": "MINOR"
},
{
"elems": [
"state",
"type-id"
],
"key": "string_val",
"value": "License"
}
]
},
"sensor_name": "sensor_1038",
"sequence_number": "104157",
"streamed_path": "/system/alarms/",
"subscribed_path": "/system/alarms/",
"system_id": "ngpr-brackla-1a"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants