gpt4 book ai didi

正则表达式清理我的 Grafana 图例

转载 作者:行者123 更新时间:2023-12-05 05:22:38 28 4
gpt4 key购买 nike

我的 grafana 仪表板图例中有这些名称:

  • stats.gauges.all.cloudwatch.communicationapi.dynamodb.ca_communicationapi_restaurantdispatchmethods.provisionedreadcapacityunits.maximum
  • stats.gauges.all.cloudwatch.communicationapi.dynamodb.es_communicationapi_restaurantdispatchmethods.consumedreadcapacityunits.maximum
  • stats.gauges.all.cloudwatch.communicationapi.dynamodb.ca_communicationapi_restaurantdispatchmethods.provisionedreadcapacityunits.maximum

我想提取国家和参数类型。我已经尝试过 AliasByNode,但名称仍然很长。有没有办法得到类似的东西:

  • ca-provisioned
  • es-消费
  • ca-provisioned

也许 AliasSub 可以做到,但正则表达式查询似乎非常复杂。有什么想法吗?

最佳答案

您可以使用此表达式来捕获您需要的内容。

stats\.gauges\.all\.cloudwatch\.communicationapi\.dynamodb\.(\w{2})_communicationapi_restaurantdispatchmethods\.(\w+)readcapacityunits\.maximum

它有点长,但你会得到你要找的东西。

https://regex101.com/r/PE5jY4/1

关于正则表达式清理我的 Grafana 图例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39789455/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com