k8s中如何获取输出内容中的指定部分内容?

How to obtain the specified part of the content from the output content in k8s?

使用kubectl get -o yaml/json获取资源信息时,输出内容过于详细,如何获取指定部分内容?

[root@ops-harbor ~]# kubectl get -n monitoring prometheus-prome-prometheus-operator-prometheus-0 -ojson

{
    "apiVersion": "v1",
    "kind": "Pod",
    "metadata": {
        "creationTimestamp": "2021-11-02T08:58:33Z",
        "generateName": "prometheus-prome-prometheus-operator-prometheus-",
        "labels": {
            "app": "prometheus",
            "controller-revision-hash": "prometheus-prome-prometheus-operator-prometheus-c56894959",
            "prometheus": "prome-prometheus-operator-prometheus",
            "statefulset.kubernetes.io/pod-name": "prometheus-prome-prometheus-operator-prometheus-0"
        },
        "name": "prometheus-prome-prometheus-operator-prometheus-0",
        "namespace": "monitoring",
        "ownerReferences": [
            {
                "apiVersion": "apps/v1",
                "blockOwnerDeletion": true,
                "controller": true,
                "kind": "StatefulSet",
                "name": "prometheus-prome-prometheus-operator-prometheus",
                "uid": "3c02e78b-610c-4e9c-9171-cc47b00274a3"
            }
        ],
        "resourceVersion": "2640925",
        "selfLink": "/api/v1/namespaces/monitoring/pods/prometheus-prome-prometheus-operator-prometheus-0",
        "uid": "e728914c-2a3c-4d6a-8a18-5ebec0e0cebd"
    },

# ...long long content

比如我只想获取以下2段信息


    "apiVersion": "v1",
    "kind": "Pod",

        "ownerReferences": [
            {
                "apiVersion": "apps/v1",
                "blockOwnerDeletion": true,
                "controller": true,
                "kind": "StatefulSet",
                "name": "prometheus-prome-prometheus-operator-prometheus",
                "uid": "3c02e78b-610c-4e9c-9171-cc47b00274a3"
            }
kubectl get pod -n monitoring prometheus-prome-prometheus-operator-prometheus-0 -o json | jq .metadata.ownerReferences

kubectl get pod -n monitoring prometheus-prome-prometheus-operator-prometheus-0 -o jsonpath={.metadata.ownerReferences} | jq