Update logcli doc

Signed-off-by: Xiang Dai <764524258@qq.com>
pull/350/head
Xiang Dai 6 years ago
parent e6bf5487f5
commit e510889d15
  1. 28
      docs/logcli.md

@ -2,10 +2,31 @@
Loki's main query interface is Grafana; however, a basic CLI is provided as a proof of concept. Loki's main query interface is Grafana; however, a basic CLI is provided as a proof of concept.
Once you have Loki running in a cluster, you can query logs from that cluster using the following commands: Once you have Loki running in a cluster, you can query logs from that cluster.
## Installation
### Get newest version
``` ```
$ go get github.com/grafana/loki/cmd/logcli $ go get github.com/grafana/loki/cmd/logcli
```
### Build by yourself
```
$ go get github.com/grafana/loki
$ cd $GOPATH/github.com/grafana/loki
$ go build ./cmd/logcli
```
Now `logcli` is in your current directory.
## Usage
### Example
```
$ export GRAFANA_ADDR=https://logs-us-west1.grafana.net $ export GRAFANA_ADDR=https://logs-us-west1.grafana.net
$ export GRAFANA_USERNAME=<username> $ export GRAFANA_USERNAME=<username>
$ export GRAFANA_PASSWORD=<password> $ export GRAFANA_PASSWORD=<password>
@ -20,6 +41,9 @@ Common labels: {job="cortex-ops/consul", namespace="cortex-ops"}
2018-06-25T12:52:09Z {instance="consul-8576459955-pl75w"} 2018/06/25 12:52:09 [INFO] raft: Snapshot to 475409 complete 2018-06-25T12:52:09Z {instance="consul-8576459955-pl75w"} 2018/06/25 12:52:09 [INFO] raft: Snapshot to 475409 complete
2018-06-25T12:52:09Z {instance="consul-8576459955-pl75w"} 2018/06/25 12:52:09 [INFO] raft: Compacting logs from 456973 to 465169 2018-06-25T12:52:09Z {instance="consul-8576459955-pl75w"} 2018/06/25 12:52:09 [INFO] raft: Compacting logs from 456973 to 465169
``` ```
### Configuration
You may use `--config=path/to/file` to load configuration options from a file. For an example file see `cmd/logcli/logcli-config.yaml` You may use `--config=path/to/file` to load configuration options from a file. For an example file see `cmd/logcli/logcli-config.yaml`
Configuration values are considered in the following order (lowest to highest): Configuration values are considered in the following order (lowest to highest):
@ -29,6 +53,8 @@ Configuration values are considered in the following order (lowest to highest):
The URLs of the requests are printed to help with integration work. The URLs of the requests are printed to help with integration work.
### Detail
``` ```
$ logcli help $ logcli help
usage: logcli [<flags>] <command> [<args> ...] usage: logcli [<flags>] <command> [<args> ...]

Loading…
Cancel
Save