Skip to content
Snippets Groups Projects
Commit ee9298d4 authored by Goutham Veeramachaneni's avatar Goutham Veeramachaneni Committed by Tom Wilkie
Browse files

Remove invalidated key (#56)


* Remove invalidated key

Signed-off-by: default avatarGoutham Veeramachaneni <gouthamve@gmail.com>

* Remove env, put logcli docs in separate md file.

Signed-off-by: default avatarTom Wilkie <tom.wilkie@gmail.com>
parent f2de97c8
No related branches found
No related tags found
No related merge requests found
......@@ -36,70 +36,4 @@ Grafana is Loki's UI, so you'll also want to run one of those:
$ docker run -ti -p 3000:3000 -e "GF_EXPLORE_ENABLED=true" grafana/grafana:master
```
In the Grafana UI (http://localhost:3000), log in with "admin"/"admin", add a new "Grafana Logging" datasource for `http://host.docker.internal:3100`, then go to explore and enjoy!
## Usage Instructions
Loki is running in the ops-tools1 cluster. You can query logs from that cluster
using the following commands:
```
$ go get github.com/grafana/loki/cmd/logcli
$ . $GOPATH/src/github.com/grafana/loki/env # env vars inc. URL, username etc
$ logcli labels job
https://logs-dev-ops-tools1.grafana.net/api/prom/label/job/values
cortex-ops/consul
cortex-ops/cortex-gw
...
$ logcli query '{job="cortex-ops/consul"}'
https://logs-dev-ops-tools1.grafana.net/api/prom/query?query=%7Bjob%3D%22cortex-ops%2Fconsul%22%7D&limit=30&start=1529928228&end=1529931828&direction=backward&regexp=
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
```
The `logcli` command is temporary until we have Grafana integration. The URLs of
the requests are printed to help with integration work.
```
$ logcli help
usage: logcli [<flags>] <command> [<args> ...]
A command-line for loki.
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--addr="https://log-us.grafana.net"
Server address.
--username="" Username for HTTP basic auth.
--password="" Password for HTTP basic auth.
Commands:
help [<command>...]
Show help.
query [<flags>] <query> [<regex>]
Run a LogQL query.
labels <label>
Find values for a given label.
$ logcli help query
usage: logcli query [<flags>] <query> [<regex>]
Run a LogQL query.
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--addr="https://log-us.grafana.net"
Server address.
--username="" Username for HTTP basic auth.
--password="" Password for HTTP basic auth.
--limit=30 Limit on number of entries to print.
--since=1h Lookback window.
--forward Scan forwards through logs.
Args:
<query> eg '{foo="bar",baz="blip"}'
[<regex>]
```
In the Grafana UI (http://localhost:3000), log in with "admin"/"admin", add a new "Grafana Logging" datasource for `http://host.docker.internal:3100`, then go to explore and enjoy!
\ No newline at end of file
# Log CLI usage Instructions
Loki's main UI 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:
```
$ go get github.com/grafana/loki/cmd/logcli
$ export GRAFANA_ADDR=https://logs-us-west1.grafana.net
$ export GRAFANA_USERNAME=<username>
$ export GRAFANA_PASSWORD=<password>
$ logcli labels job
https://logs-dev-ops-tools1.grafana.net/api/prom/label/job/values
cortex-ops/consul
cortex-ops/cortex-gw
...
$ logcli query '{job="cortex-ops/consul"}'
https://logs-dev-ops-tools1.grafana.net/api/prom/query?query=%7Bjob%3D%22cortex-ops%2Fconsul%22%7D&limit=30&start=1529928228&end=1529931828&direction=backward&regexp=
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
```
The URLs of the requests are printed to help with integration work.
```
$ logcli help
usage: logcli [<flags>] <command> [<args> ...]
A command-line for loki.
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--addr="https://log-us.grafana.net"
Server address.
--username="" Username for HTTP basic auth.
--password="" Password for HTTP basic auth.
Commands:
help [<command>...]
Show help.
query [<flags>] <query> [<regex>]
Run a LogQL query.
labels <label>
Find values for a given label.
$ logcli help query
usage: logcli query [<flags>] <query> [<regex>]
Run a LogQL query.
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--addr="https://log-us.grafana.net"
Server address.
--username="" Username for HTTP basic auth.
--password="" Password for HTTP basic auth.
--limit=30 Limit on number of entries to print.
--since=1h Lookback window.
--forward Scan forwards through logs.
Args:
<query> eg '{foo="bar",baz="blip"}'
[<regex>]
```
export GRAFANA_ADDR=https://logs-dev-ops-tools1.grafana.net
export GRAFANA_USERNAME=29
export GRAFANA_PASSWORD=eyJrIjoiMzJmNDRjYjI1NGI1MGUxODc3NmIzNjhlZjRkM2QzMWE5OWU4ZjllZSIsIm4iOiJ0b20tcHJvbS10ZXN0IiwiaWQiOjUwMDB9
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