From e510889d157b6a1de4344139ec6020a78b37e7cb Mon Sep 17 00:00:00 2001 From: Xiang Dai <764524258@qq.com> Date: Sat, 23 Feb 2019 11:04:41 +0800 Subject: [PATCH] Update logcli doc Signed-off-by: Xiang Dai <764524258@qq.com> --- docs/logcli.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/logcli.md b/docs/logcli.md index ebc984024bce..918ef7143afe 100644 --- a/docs/logcli.md +++ b/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. -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= $ export GRAFANA_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 [] [ ...]