V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
wandehul
V2EX  ›  问与答

[知识付费]如何将 grafana variable 匹配的值变换格式

  •  
  •   wandehul · Feb 2, 2024 · 999 views
    This topic created in 821 days ago, the information mentioned may be changed or developed.
    例如: 变量 name 通过 label_values(metricsName, label)获取到 string 格式:

    abc123456789

    现想将 string 格式化为 abc-123456789

    留下 vx ,20 元红包献上。
    Supplement 1  ·  Feb 2, 2024
    算了, 用正则多匹配几次,再拼接。 不优雅就不优雅吧
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   807 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 19:40 · PVG 03:40 · LAX 12:40 · JFK 15:40
    ♥ Do have faith in what you're doing.