jq 使用方法

情況一

要 json 出現的列表,grep 出想要的字串
sample

 {
    "AtkPeakBps": "14070.00",
    "AtkPeakPps": "159.758",
    "AtkStartTime": 1629881728,
    "AtkType": "UDP_FLOOD|UDP_FRAG|R_NTP_FLOOD|R_DNS_FLOOD|R_SSDP_FLOOD",
    "CostTime": 7,
    "DetailId": 1391778,
    "EventId": 18132366,
    "Ip": "xx.xx.xx.xx",
    "MoreDetail": 1,
    "PktFileUrl": "http://ddospcap-3001.hk.ufileos.com/2021-08-25-16:55:20-122.10.161.8.pcap_94780d58.gz",
    "Region": 3001,
    "Type": 0
  }

基本有二層
到第二層再.[]. 到第三層 grep

 jq  -r '.AtkEvents| .[].Ip'