Skip to content

Commit

Permalink
Update logcli doc
Browse files Browse the repository at this point in the history
Signed-off-by: Xiang Dai <764524258@qq.com>
  • Loading branch information
daixiang0 committed Feb 23, 2019
1 parent e6bf548 commit e510889
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/logcli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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):
Expand All @@ -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> ...]
Expand Down

0 comments on commit e510889

Please sign in to comment.