@KPS hello. Sorry for the late answer, I am just starting using Xcpng (and xo-cli).
As for your jq program you can start by piping into jq .
and then you will see that the returned json is a list of list of list where.. you will find a timestamp
field. So you cannot directly request .timestamp
you have to use something like:
$ xo-cli backupNg.listVmBackups --json remotes="json:[\"$REMOTEUUID\"]" \
| jq '.[][][].timestamp'
1721253629744
1721253606389
in order to get all timestamp fields from the lists of lists of lists.
Then if you want to get several fields it is possible to create new jsons with new field names (or the same) their value being extracted from the parsed json. For example here I create jsons with "VM" and "timestamp" fields:
$ xo-cli backupNg.listVmBackups --json remotes="json:[\"$REMOTEUUID\"]" \
| jq '.[][][] | {VM: .vm.name_label, timestamp: .timestamp}'
{
"VM": "XenOrchestra",
"timestamp": 1721253675148
}
{
"VM": "RockyBench",
"timestamp": 1721253606389
}
Hope it'll help.
Here is a small tutorial: https://mosermichael.github.io/jq-illustrated/dir/content.html
And the reference doc: https://jqlang.github.io/jq/manual/
Cheers,
Christophe.