splunk - Splunk:分配变量
问题描述
我在 splunk 中有一些数据,我试图为其创建仪表板。我不确定如何为要提取的 2 条数据分配变量名称。我的数据看起来像
From 5 new registrations, 4 emails were confirmed
我可以使用以下查询非常轻松地搜索此数据
search "From * new registrations, * emails were confirmed"
如何为每个星号分配一个变量?
谢谢!
解决方案
可能有几种方法可以做到这一点。我喜欢使用正则表达式和rex
命令。
index=foo "From * new registrations, * emails were confirmed"
| rex "From (?<fromCount>\d+) new registrations, (?<emailCount>\d+) emails were confirmed"
推荐阅读
- botframework - Bot 未显示在 Teams 频道通话中
- azure - Azure APIM 中具有不同身份验证要求的多个 API
- angular - Spring Boot 如何使用 BCrypt 进行身份验证/登录
- javascript - 一个 onClick-React.js 的两个动作
- discord.js - 如何创建清除命令
- javascript - 检查对象是否是 Node.JS 中特定对象实例的数组
- javascript - 从页面检索信息并将其提交给 JavaScript 对象构造函数时出现问题
- console - Digital Ocean 无法访问控制台
- vue.js - Vue CLI 可以为 Vue 3 构建一个库吗?
- jquery - jQuery第一次点击打开子菜单,如果有href属性,第二次转到url