Giter Site home page Giter Site logo

consult's Introduction

Consult

Query Consul from the command line and SSH into a server from Consul catalog.

Build Status

Building

go get -u github.com/outbrain/consult

Using

consult needs to know where Consul's API is, this can be configured using the CONSUL_URL environment variable or the --server command line flag. Run consult -h or consult help for a complete list of flags.

Misc flags

  • --json, -j - JSON output
  • --detailed, -d - Print detailed results with header line
  • --dc=DC_NAME - Datacenter to query, can be specified multiple times
  • --all-dcs - Query all datacenters. Overrides the --dc flag

Query subcommand

To list the node for service and tag:

consult query --service=my_awesome_service --tag=some_tag

Multiple tags - you can choose to match any or all tags. By default, all tags must be matched.

consult query -s my_awesome_service -t tag1 -t tag2 -m any

Multiple datacenter support

consult query -s service1 --dc dc1 --dc dc2
consult query -s service1 --all-dcs

query flags also work on http and ssh subcommands.

ssh subcommand

consult ssh --service=my_awesome_service --tag=some_tag --username=joe

--username is optional of course

http subcommand

Perform an HTTP request on endpoints returned from Consul query:

consult http -s service1 -t tag1 --all-endpoints --uri="/ping"

For other options check out consul help http

List subcommands

consult list dc
consult list service --dc dc1 --dc dc2
consult list node -r '^ap.*a' # list node matching regex

License

Apache V2

consult's People

Contributors

nukemberg avatar

Watchers

James Cloos avatar  avatar

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.