Skip to content
Snippets Groups Projects
Commit e510889d authored by Xiang Dai's avatar Xiang Dai
Browse files

Update logcli doc


Signed-off-by: default avatarXiang Dai <764524258@qq.com>
parent e6bf5487
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,31 @@
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
```
### 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_USERNAME=<username>
$ 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: 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`
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.
### Detail
```
$ logcli help
usage: logcli [<flags>] <command> [<args> ...]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment