Removing multiple lines

Removing multiple lines

Hi all, I am pretty new to jQ and I am trying to write up a command line interfaces that will removes a particular section / lines of codes within a list of json files. By the way, the json file are located within the sub-folders of the main directory

Well, I came up with this code find -name "*.json" | xargs sed -i "map" but I came to realize that I will not be able to achieve the outputs that I wanted as some of the json files I had, its format and contents are slightly different too.

So far I am seeing the following 2 formats within my list:

  1. {
        "tags": {}, 
        "map": {
            "KPA": {
                "State": True, 
                "namespace": "KPA01"
            }
        }
    }
  2. {
        "tags": {
            "type": [
                "char"
            ], 
            "dynamic": true
        }, 
        "map": {
            "KPA01": {
               "State": True, 
                "namespace": "KPA01"
            }
        }
    }

Having said that, I had wanted to omit out the map section (everything under it) that it has, so that it will only display the tags section but the presence of commas and [] / {} are making it hard for me.

And thus was wondering if someone could help me or point in the correct direction to do so? via command line? I apologize if I have started this in the wrong thread but I really do need help..