jq最简单的功能就是格式化。
给一段json(下面一直要用到):
{"code":0,"data":{"01":[{"answer":{"time_consume":"0.32","records":[{"ttl":5,"value":"39.156.69.79","ip_location":"北京"},{"ttl":5,"value":"220.181.38.148","ip_location":"北京"}],"error":""}}],"852":[{"answer":{"time_consume":"0.23","records":[{"ttl":600,"value":"39.156.69.79","ip_location":"北京"},{"ttl":600,"value":"220.181.38.148","ip_location":"北京"}],"error":""}}],"86":[{"answer":{"time_consume":"0.00","records":[{"ttl":4,"value":"220.181.38.148","ip_location":"北京"},{"ttl":4,"value":"39.156.69.79","ip_location":"北京"}],"error":""}}]}}
看着心累,对不对?
给一段json(下面一直要用到):
{"code":0,"data":{"01":[{"answer":{"time_consume":"0.32","records":[{"ttl":5,"value":"39.156.69.79","ip_location":"北京"},{"ttl":5,"value":"220.181.38.148","ip_location":"北京"}],"error":""}}],"852":[{"answer":{"time_consume":"0.23","records":[{"ttl":600,"value":"39.156.69.79","ip_location":"北京"},{"ttl":600,"value":"220.181.38.148","ip_location":"北京"}],"error":""}}],"86":[{"answer":{"time_consume":"0.00","records":[{"ttl":4,"value":"220.181.38.148","ip_location":"北京"},{"ttl":4,"value":"39.156.69.79","ip_location":"北京"}],"error":""}}]}}
看着心累,对不对?