https://github.com/bd808/ggml
:mag: Go Get My Logs - Logstash search client written in Go (golang)
https://github.com/bd808/ggml
Last synced: 3 months ago
JSON representation
:mag: Go Get My Logs - Logstash search client written in Go (golang)
- Host: GitHub
- URL: https://github.com/bd808/ggml
- Owner: bd808
- License: mit
- Created: 2015-05-11T04:53:08.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-05T17:58:51.000Z (over 10 years ago)
- Last Synced: 2025-10-20T10:27:40.707Z (8 months ago)
- Language: Go
- Homepage:
- Size: 172 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Go Get My Logs
==============
Search and display Logstash formatted logs from an Elasticsearch server.
Usage
-----
```
usage: ggml [] []
Search for logs in a Logstash Elasticsearch index.
Flags:
--help Show help.
-u, --url=http://127.0.0.1:9200
Server URL
-m, --must=MUST Must match
-x, --must-not=MUST-NOT
Must not match
--start=START Oldest timestamp to match
--end=END Newest timestamp to match
-d, --duration=15m Width of timestamp window
-t, --tail Tail event stream
-n, --num=100 Number of results to fetch
--index-format="logstash-%Y.%m.%d"
Index name format
-o, --output-format="{@timestamp} {host} {type} {level}: {message}"
Output format
--verbose Enable verbose mode
--debug Enable debug mode
--version Show application version.
Args:
[] Elasticsearch query string
```
Some settings can be provided via environment variables:
* `GGML_URL`: Server URL
* `GGML_OUTPUT`: Output format
Examples:
```
# Custom output format for a specific event type
$ export GGML_OUTPUT="{@timestamp} {level} {channel} {host} {wiki} - {message}"
# Query string
$ ggml type:mediawiki AND NOT channel:api-feature-usage AND host:mw1070
# With must/mustNot filters (filters are cached by Elastcisearch)
$ ggml -m type:mediawiki -x channel:api-feature-usage -m host:mw1070
```
Build
-----
You need go version 1.3 or higher to build ggml. Ubuntu precise installs go 1.2 and both build options below
will fail. So, install from src or a prebuilt binary from https://golang.org/doc/install
```
export GOPATH=~/golang # Or any other directory you'd like to use
mkdir -p $GOPATH
go get github.com/bd808/ggml
$GOPATH/bin/ggml --help
```
Build Debian package
```
apt-get install dpkg-dev golang-go
git clone https://github.com/bd808/ggml.git
cd ggml
dpkg-buildpackage -b -us -uc
```
License
-------
Go Get My Logs is licensed under the MIT license. See the `LICENSE` file for
more details.