Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit f94e836

Browse files
authoredAug 22, 2018
Merge pull request #1012 from grafana/mt-index-cat-suffix
suffix filter for mt-index-cat
2 parents 7115145 + 9556fd3 commit f94e836

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
 

‎cmd/mt-index-cat/main.go

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func main() {
2626
var addr string
2727
var prefix string
2828
var substr string
29+
var suffix string
2930
var tags string
3031
var from string
3132
var maxAge string
@@ -36,6 +37,7 @@ func main() {
3637
globalFlags.StringVar(&addr, "addr", "http://localhost:6060", "graphite/metrictank address")
3738
globalFlags.StringVar(&prefix, "prefix", "", "only show metrics that have this prefix")
3839
globalFlags.StringVar(&substr, "substr", "", "only show metrics that have this substring")
40+
globalFlags.StringVar(&suffix, "suffix", "", "only show metrics that have this suffix")
3941
globalFlags.StringVar(&tags, "tags", "", "tag filter. empty (default), 'some', 'none', 'valid', or 'invalid'")
4042
globalFlags.StringVar(&from, "from", "30min", "for vegeta outputs, will generate requests for data starting from now minus... eg '30min', '5h', '14d', etc. or a unix timestamp")
4143
globalFlags.StringVar(&maxAge, "max-age", "6h30min", "max age (last update diff with now) of metricdefs. use 0 to disable")
@@ -175,6 +177,9 @@ func main() {
175177
if !strings.HasPrefix(d.Name, prefix) {
176178
continue
177179
}
180+
if !strings.HasSuffix(d.Name, suffix) {
181+
continue
182+
}
178183
if !strings.Contains(d.Name, substr) {
179184
continue
180185
}

‎docs/tools.md

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ global config flags:
7070
only show metrics that have this prefix
7171
-substr string
7272
only show metrics that have this substring
73+
-suffix string
74+
only show metrics that have this suffix
7375
-tags string
7476
tag filter. empty (default), 'some', 'none', 'valid', or 'invalid'
7577
-verbose

0 commit comments

Comments
 (0)
This repository has been archived.