Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何把mysql查询的数据全都显示在消息模板里面 #162

Open
PrincessTG opened this issue Mar 19, 2024 · 3 comments
Open

如何把mysql查询的数据全都显示在消息模板里面 #162

PrincessTG opened this issue Mar 19, 2024 · 3 comments

Comments

@PrincessTG
Copy link

我使用的是mysql监控,查询出来的数据有多条。类似这样:

@PrincessTG
Copy link
Author

"NUMBER":2,
"ALERT_SILENCE":0,
"failureCause":"{"msg":"groovy.util.ResourceException: 我是错误2}",
"ALERT_CONDITION":"1",
"traceKey":"PB20240314046369",
"TOP_N_DOCUMENTS":[
{
"failureCause":"{"msg":"groovy.util.ResourceException: 我是错误2}",
"traceKey":"PB20240314046369",
"taskType":"edi-2016-quote",
"startTime":"2024-03-19T19:52:08"
},
{
"failureCause":"{"msg":"groovy.util.ResourceException: Cannot open 我是错误1}",
"traceKey":"PB20240314046369",
"taskType":"edi-2016-quote",
"startTime":"2024-03-19T19:35:45"
}
],
"ALARM_ID":1,
"taskType":"edi-2016-quote",
"THRESHOLD":"1",
"TIME_WINDOW":"1",
"OPERATOR":"GTE",
"headFields":"",
"startTime":"2024-03-19T19:52:08",
"CURRENT_TIME":"2024-03-19 17:51:55",
"EXPRESSION":"failureCause.indexOf("Exception") !== -1;",
"ALARM_NAME":"测试1"

@PrincessTG
Copy link
Author

可以将TOP_N_DOCUMENTS里的数据,分条显示在消息模板里面吗?如果可以,我应该如何来配置我的消息模板

@LittleShrimp1987
Copy link
Collaborator

可以,自己定制消息模板,freemarker语法支持遍历

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants