rolinh / elastic-go Goto Github PK
View Code? Open in Web Editor NEWA command-line tool to query the Elasticsearch REST API
License: BSD 3-Clause "New" or "Revised" License
A command-line tool to query the Elasticsearch REST API
License: BSD 3-Clause "New" or "Revised" License
Is there currently any way to run a query against a specific index?
The functionality I am thinking of is like so: elastic query -i logstash-* myquery
The program's output also includes ANSI color codes to colorize output.
This is very annoying if you're piping the output to parse it with tools such as jq
or similar. The workaround is to sed
the output, but it is clunky and a --nocolor
switch or similar would be easier and more clean.
Also, I've tried setting the TERM
env var to xterm-mono
or vt220
, but I guess there is no terminfo checking to see if the terminal supports colors or not, which would also be a good solution.
Hi, thanks for writing this.
Thought it would save me from having to learn the ES API or write anything myself right away.
However, I haven't been able to make a successful query
command in about 20 minutes of trying (even after pulling up the ES API docs and learning the query language) -- what is the expected input format? JSON? A couple query examples in the README would help.
Probably going to move onto something else or use curl at this point. Thought you'd like to know.
Docker Hub allows you to create Automated Builds from source: https://docs.docker.com/docker-hub/builds/
It would add another packaging/distribution/installation method, whose buildings would be triggered automatically on each commit. It also allows to create different image tags automatically from git tags & branches.
Also, documentation could include an example docker run
command which would become the canonical, no-install-needed way to run latest elastic-go.
By making the image build via an AB, you give the resulting image verifiability and auditability. Also, the build is fully automatic. You can have the latest image tag build from HEAD and individual image tags from git's release tags. Some people avoid non-verifiable (manually uploaded) images due to security & traceability reasons.
After #2 is in, just a free Docker Hub account and a quick setup would do. Ping me if you need help.
○ → go get -u github.com/Rolinh/elastic-go
# github.com/Rolinh/elastic-go
go/src/github.com/Rolinh/elastic-go/elastic.go:33:5: app.Author undefined (type *cli.App has no field or method Author)
go/src/github.com/Rolinh/elastic-go/elastic.go:34:5: app.Email undefined (type *cli.App has no field or method Email)
go/src/github.com/Rolinh/elastic-go/elastic.go:36:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/Rolinh/elastic-go/elastic.go:41:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/Rolinh/elastic-go/elastic.go:49:4: unknown field 'ShortName' in struct literal of type cli.Command
go/src/github.com/Rolinh/elastic-go/elastic.go:54:6: unknown field 'ShortName' in struct literal of type cli.Command
go/src/github.com/Rolinh/elastic-go/elastic.go:56:6: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in field value
go/src/github.com/Rolinh/elastic-go/elastic.go:66:6: unknown field 'ShortName' in struct literal of type cli.Command
go/src/github.com/Rolinh/elastic-go/elastic.go:68:6: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in field value
go/src/github.com/Rolinh/elastic-go/elastic.go:78:6: unknown field 'ShortName' in struct literal of type cli.Command
go/src/github.com/Rolinh/elastic-go/elastic.go:78:6: too many errors
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.