2017-07-07 51 views
0

我已经很好地阅读了关于此的文档,但我仍然不明智。 http://graphite.readthedocs.io/en/latest/config-carbon.htmlGraphite storage-aggregation.conf正则表达式范围

如果我们有一个指标,像这样:

/var/lib/graphite/whisper/p1/p2/account/count_num_events.wsp

有谁知道知道到底这条路径石墨的哪一部分将存储聚合正则表达式应用于?

我认为这将是刚刚

“count_num_events”

,因此我可以使用正则表达式 “^计数。*” 来匹配它。还是将其应用于路径的全部或部分?

干杯。

回答

1

你是对的。那将是你需要的东西。但要注意的指标将使用点不斜线

p1.p2.account.count_num_events 

那么你需要在存储聚合是下列任何

*count_num_events 
p1.p2.*.count_num_events 
p1.*.account.count_num_events 
*.account.count_num_events 
*.count_num_events 
*count_num_events$ 
p1.p2.account.count_num_events 
+0

这并不提供答案的问题。一旦你有足够的[声誉](https://stackoverflow.com/help/whats-reputation),你将可以[对任何帖子发表评论](https://stackoverflow.com/help/privileges/comment);相反,[提供不需要提问者澄清的答案](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- I-DO-代替)。 - [来自评论](/ review/low-quality-posts/16740452) –

0

我终于得到全面在此做一些测试。

感谢您的答复Fred S我希望在做测试之前看到了答案,会有所帮助。

所以答案是石墨匹配完整的度量名称是。分离。这对于例如度量标准文件:

/var/lib/graphite/whisper/p1/p2/account/count_num_events.wsp

是:

p1.p2。 account.count_num_events

所以最严格的正则表达式,你可以做的是:

^P1 \ .p2 \ .account \ .count_num_events $