regex - GCP Cloud Sql使用正则表达式提取查询持续时间
问题描述
我目前有一个 GCP Stackdriver Logging Metric Editor 不接受的正则表达式。
(?<=duration: )(-?[0-9]+(?:[,.][0-9]+)?)(?= ms)
我在哪里得到反馈Regular expression must be valid and include exactly one non-empty match group, indicated by parentheses.
。
链接到我最初创建它的位置:regexr.com/4t3hl
"[19087]: [612-1] db=test_database,user=test LOG: duration: 0.877 ms statement: COMMIT;"
有谁知道我需要做什么来使用这个正则表达式提取查询响应时间?
解决方案
推荐阅读
- javascript - 导出默认值有效,但在 React 中无法导出任何其他内容
- node.js - 如何执行并获得 NodeJS 承诺的结果?
- node.js - 如何将图像上传到 Firebase?可能吗?
- python - 运行 dockerised Hello world python 示例时执行格式错误
- azure - Azure 自定义 DNS 服务器未刷新
- ios - GMSAutocompleteViewController 仅显示 5 个结果
- java - Eclipse:在 Eclipse 版本中更改了 ctrl+shift+/ 格式的块注释样式:2018-12 (4.10.0)
- mysql - mysql5.7 ON DUPLICATE KEY UPDATE 语法将更新额外的列
- java - Spring Boot @RestController 动态接受不同结构 bean 对象的 @RequestBody 并验证请求
- python - Python Configparser 未读取文件。说文件不存在