zoukankan      html  css  js  c++  java
  • linux 解析json

    epel源

    yum install jq

    ======================

    [root@mhc NaHan-master]# curl 127.0.0.1:5000/v2/_catalog|jq .
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100    36  100    36    0     0   9922      0 --:--:-- --:--:-- --:--:-- 12000
    {
      "repositories": [
        "consul",
        "redis"
      ]
    }
    ======================================

    [root@mhc NaHan-master]# curl 127.0.0.1:5000/v2/_catalog|jq .repositories
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100    36  100    36    0     0  11892      0 --:--:-- --:--:-- --:--:-- 18000
    [
      "consul",
      "redis"
    ]
    [root@mhc NaHan-master]# curl 127.0.0.1:5000/v2/_catalog|jq .repositories
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100    36  100    36    0     0   4063      0 --:--:-- --:--:-- --:--:--  4500
    [
      "consul",
      "redis"
    ]
    [root@mhc NaHan-master]# curl 127.0.0.1:5000/v2/_catalog|jq .repositories[0]
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100    36  100    36    0     0  12092      0 --:--:-- --:--:-- --:--:-- 18000
    "consul"
    [root@mhc NaHan-master]# curl 127.0.0.1:5000/v2/_catalog|jq .repositories[1]
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100    36  100    36    0     0  10332      0 --:--:-- --:--:-- --:--:-- 12000
    "redis"

  • 相关阅读:
    (4.7)怎么捕获和记录SQL Server中发生的死锁?
    SQLSERVER排查CPU占用高的情况
    (4.6)sql server索引缺失提示
    (4.14)向上取整、向下取整、四舍五入取整的实例
    mysql大致学习路径
    (2)linux未使用eth0,未使用IPV4导致无法连接
    (4.13)sql server参数嗅探(parameter sniffing)
    完美女人
    关于box-sizing
    什么是担当
  • 原文地址:https://www.cnblogs.com/mhc-fly/p/7273408.html
Copyright © 2011-2022 走看看