Skip to main content

Output formats

-o is a global flag. It defaults to table.

FormatShapeUse for
tableBordered text, one row per itemReading in a terminal
jsonPretty-printed JSON of the list or objectScripts and jq
yamlYAML of the list or objectReading structured output, diffing
onmsctl event-source names -o json
[
"opennms.alarm.events",
"opennms.catch-all.events",
"opennms.linkd.events",
...
"opennms.discovery.events",
"opennms.ticketd.events"
]

Pipe the JSON into jq:

onmsctl event-source list -o json | jq .
[
{
"id": 23,
"name": "opennms.catch-all.events",
"vendor": "opennms",
"description": "",
"fileOrder": 1,
"eventCount": 4,
"enabled": true,
"createdTime": 1790699343537,
"lastModified": 1790699343537,
"uploadedBy": "system-migration"
},
...
]

Commands that override -o​

Commands whose output is a document ignore part or all of -o:

CommandOutput
event-source exportAlways YAML
requisition exportYAML for table and yaml; JSON only for -o json
threshold group get, threshold package get, threshold exportAlways YAML

With -o json, requisition export wraps each requisition's YAML in a JSON object:

onmsctl requisition export poc-scale -o json
[
{
"foreign_source": "poc-scale",
"yaml": "# yaml-language-server: $schema=https://raw.githubusercontent.com/no42-org/onmsctl/main/schemas/requisition.schema.json\napiVersion: provisioning.opennms.org/v1\nkind: Requisition\nmetadata:\n name: poc-scale\nspec:\n foreignSource:\n scanInterval: 1d\n nodes: []\n",
"default_fs_inlined": false
}
]