Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 splunk 上遇到 rex 命令问题。我的查询输出以下内容。
{"(001) NULL.COUNT(1).NUMBER": "12345"}
我正在寻找仅提取值 12345,但目前,我有以下rex命令返回“ {"(001) NULL.COUNT(1).NUMBER": "12345"}”。
rex
| rex field=_transfers "(001) NULL.COUNT(1).NUMBER": "(?<value>.*)"
引号必须在rex命令中转义。此外,如果正则表达式字符串中的括号不属于捕获组,则必须对其进行转义。试试| rex field=_transfers "\\(001) NULL.COUNT\\(1).NUMBER\\": \\"(?<value>.*)"。
| rex field=_transfers "\\(001) NULL.COUNT\\(1).NUMBER\\": \\"(?<value>.*)"