Skip to content
Advertisement

Remove specific data from json file in linux

I have a json file with set of data with repeating fields. I need to remove an entry with specific data of a field.

Json file:

JavaScript

The json file goes on and but this is an example of the whole json file.

I need to remove an entry of targets with its labels given a data of the target's IP.

Input:

JavaScript

expected output:

JavaScript

Advertisement

Answer

Using jq:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement