如何在Grok Parser中组合两个变量
我的日志示例:
Process Process[spinup-app-3,5,main] has been running for 9740 ms, time limit is 2000 ms
我当前的grok praser
rule1 Process\s+Process\[%{data:appName}-%{integer:appID},%{integer:Count},main\]\s+%{data}\s%{number:duration}\s+%{data}\s%{number:duration}\s+ms
Current Output
{
"duration": [
9740,
2000
],
"appName": "spinup-app",
"appID": 3,
"Count": 5
}
我想组合appName
和appid
以形式task> task> task
(如下所示)我该如何实现?
desired Output
{
"duration": [
9740,
2000
],
"task": "spinup-app-3"
"appName": "spinup-app",
"appID": 3,
"Count": 5
}
My log Sample:
Process Process[spinup-app-3,5,main] has been running for 9740 ms, time limit is 2000 ms
My Current Grok Praser
rule1 Process\s+Process\[%{data:appName}-%{integer:appID},%{integer:Count},main\]\s+%{data}\s%{number:duration}\s+%{data}\s%{number:duration}\s+ms
Current Output
{
"duration": [
9740,
2000
],
"appName": "spinup-app",
"appID": 3,
"Count": 5
}
I want to combine appName
and appID
to form task
(Like shown below) how can I achieve this?
desired Output
{
"duration": [
9740,
2000
],
"task": "spinup-app-3"
"appName": "spinup-app",
"appID": 3,
"Count": 5
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加a noreflow noreferrer“您的管道中的grok解析器创建
task
属性。%{appName} - %{appid}
Add a String Builder Processor after your Grok Parser in your pipeline to create the
task
attribute.%{appName}-%{appID}