I have a Json with this kind of records and I want to filter it using jq or grep to get an output with only the full records where "__pod_controller_name" its "podIwant"
{
"endpoint": "http://10.225.25.33:8080/metrics",
"properties": {
"__pod_name": "pod1",
"__pod_controller_name": "podIwant"
}
}
{
"endpoint": "http://10.225.10.21:8080/metrics",
"properties": {
"__pod_name": "pod2",
"__pod_controller_name": "podIdontwant"
}
}
{
"endpoint": "http://10.225.33.52:8080/metrics",
"properties": {
"__pod_name": "pod3",
"__pod_controller_name": "podIwant"
}
}
I've been trying with a lot of jq and map commands but I could not. Thanks.