Giter VIP home page Giter VIP logo

json-query's Introduction

json-query

JSON query is a simple tool to query json input by key.

Installation

pip install json-query

Examples

$ curl -s http://127.0.0.1:9200/_cluster/health | json-query
{
    "active_primary_shards":11111,
    "active_shards":222222,
    "cluster_name":"ClusterName",
    "initializing_shards":0,
    "number_of_data_nodes":33,
    "number_of_nodes":11,
    "relocating_shards":0,
    "status":"green",
    "timed_out":false,
    "unassigned_shards":0
}

$ curl -s http://127.0.0.1:9200/_cluster/health | json-query .
status
number_of_nodes
unassigned_shards
timed_out
active_primary_shards
cluster_name
relocating_shards
active_shards
initializing_shards
number_of_data_nodes

$ curl -s http://127.0.0.1:9200/_cluster/health | json-query status
green
$ curl -s http://127.0.0.1:5050/master/state.json | json-query .
id
hostname
deactivated_slaves
flags
slaves

$ curl -s http://127.0.0.1:5050/master/state.json | json-query .slaves.5.used_resources
{
    "cpus":0.95,
    "disk":0,
    "mem":1792,
    "ports":"[31640-31640, 31978-31978, 31644-31644]"
}

$ curl -s http://127.0.0.1:5050/master/state.json | json-query .slaves.5.used_resources.mem
1792

json-query's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

collabsoft

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.