Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Loki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Loki
Commits
cd270dc4
Commit
cd270dc4
authored
6 years ago
by
Xiang Dai
Committed by
Tom Wilkie
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
logcli: remove default url (#194)
Signed-off-by:
Xiang Dai
<
764524258@qq.com
>
parent
e3e4a2d9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/logcli/main.go
+6
-1
6 additions, 1 deletion
cmd/logcli/main.go
docs/logcli.md
+2
-4
2 additions, 4 deletions
docs/logcli.md
with
8 additions
and
5 deletions
cmd/logcli/main.go
+
6
−
1
View file @
cd270dc4
package
main
import
(
"fmt"
"os"
kingpin
"gopkg.in/alecthomas/kingpin.v2"
...
...
@@ -8,7 +9,7 @@ import (
var
(
app
=
kingpin
.
New
(
"logcli"
,
"A command-line for loki."
)
addr
=
app
.
Flag
(
"addr"
,
"Server address."
)
.
Default
(
"
https://log-us.grafana.net
"
)
.
Envar
(
"GRAFANA_ADDR"
)
.
String
()
addr
=
app
.
Flag
(
"addr"
,
"Server address."
)
.
Default
(
""
)
.
Envar
(
"GRAFANA_ADDR"
)
.
String
()
username
=
app
.
Flag
(
"username"
,
"Username for HTTP basic auth."
)
.
Default
(
""
)
.
Envar
(
"GRAFANA_USERNAME"
)
.
String
()
password
=
app
.
Flag
(
"password"
,
"Password for HTTP basic auth."
)
.
Default
(
""
)
.
Envar
(
"GRAFANA_PASSWORD"
)
.
String
()
...
...
@@ -27,6 +28,10 @@ var (
func
main
()
{
switch
kingpin
.
MustParse
(
app
.
Parse
(
os
.
Args
[
1
:
]))
{
case
queryCmd
.
FullCommand
()
:
if
*
addr
==
""
{
fmt
.
Println
(
"Server address cannot be empty"
)
os
.
Exit
(
1
)
}
doQuery
()
case
labelsCmd
.
FullCommand
()
:
doLabels
()
...
...
This diff is collapsed.
Click to expand it.
docs/logcli.md
+
2
−
4
View file @
cd270dc4
...
...
@@ -31,8 +31,7 @@ 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.
--addr="" Server address, need to specify.
--username="" Username for HTTP basic auth.
--password="" Password for HTTP basic auth.
...
...
@@ -53,8 +52,7 @@ 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.
--addr="" Server address, need to specify.
--username="" Username for HTTP basic auth.
--password="" Password for HTTP basic auth.
--limit=30 Limit on number of entries to print.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment