正则表达式清理我的 Grafana 图例
Regex to clean my Grafana legend
我的 grafana 仪表板图例中有这些名称:
- stats.gauges.all.cloudwatch.communicationapi.dynamodb.ca_communicationapi_restaurantdispatchmethods.已配置readcapacityunits.maximum
- stats.gauges.all.cloudwatch.communicationapi.dynamodb.es_communicationapi_restaurantdispatchmethods.消费readcapacityunits.maximum
- stats.gauges.all.cloudwatch.communicationapi.dynamodb.ca_communicationapi_restaurantdispatchmethods.已配置readcapacityunits.maximum
我想提取国家和参数类型。我已经尝试过 AliasByNode,但名称仍然很长。有没有办法得到类似的东西:
- ca-provisioned
- es-消耗
- ca-provisioned
也许 AliasSub 可以做到,但正则表达式查询似乎非常复杂。有什么想法吗?
您可以使用此表达式来捕获您需要的内容。
stats\.gauges\.all\.cloudwatch\.communicationapi\.dynamodb\.(\w{2})_communicationapi_restaurantdispatchmethods\.(\w+)readcapacityunits\.maximum
它有点长,但你会得到你想要的。
我的 grafana 仪表板图例中有这些名称:
- stats.gauges.all.cloudwatch.communicationapi.dynamodb.ca_communicationapi_restaurantdispatchmethods.已配置readcapacityunits.maximum
- stats.gauges.all.cloudwatch.communicationapi.dynamodb.es_communicationapi_restaurantdispatchmethods.消费readcapacityunits.maximum
- stats.gauges.all.cloudwatch.communicationapi.dynamodb.ca_communicationapi_restaurantdispatchmethods.已配置readcapacityunits.maximum
我想提取国家和参数类型。我已经尝试过 AliasByNode,但名称仍然很长。有没有办法得到类似的东西:
- ca-provisioned
- es-消耗
- ca-provisioned
也许 AliasSub 可以做到,但正则表达式查询似乎非常复杂。有什么想法吗?
您可以使用此表达式来捕获您需要的内容。
stats\.gauges\.all\.cloudwatch\.communicationapi\.dynamodb\.(\w{2})_communicationapi_restaurantdispatchmethods\.(\w+)readcapacityunits\.maximum
它有点长,但你会得到你想要的。