Skip to content

Commit 950437b

Browse files
authored
Update template for alert summary with new log pattern tools (#1021)
* Update template for alert summary with log pattern Signed-off-by: Sihan He <[email protected]> * Update ChangeLog Signed-off-by: Sihan He <[email protected]> --------- Signed-off-by: Sihan He <[email protected]>
1 parent fab4286 commit 950437b

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
1212

1313
### Documentation
1414
- Add text to visualization agent template ([#936](https://github.com/opensearch-project/flow-framework/pull/936))
15-
15+
- Update template for alert summary with new log pattern tools ([#1021](https://github.com/opensearch-project/flow-framework/pull/1021))
1616
### Maintenance
1717
### Refactoring
1818

sample-templates/alert-summary-log-pattern-agent.json

+15-2
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,30 @@
6969
},
7070
"user_inputs": {
7171
"parameters": {
72-
"prompt": " You are an OpenSearch Alert Assistant to help summarize the alerts.\n Here is the detail of alert: \n ${parameters.context};\n \n And help detect if there is any common pattern or trend or outlier for the log pattern output. Log pattern groups the alert trigger logs by their generated patterns, the output contains some sample logs for each top-k patterns.\n Here is the log pattern output:\n ${parameters.topNLogPatternData};"
72+
"prompt": "<task_description>\nYou are an OpenSearch Alert Assistant tasked with summarizing alerts and analyzing log patterns to provide insights into the alert's cause and potential impact.\n</task_description>\n\n<instructions>\n1. Summarize the alert information provided in <extracted_context_1>${parameters.context}</extracted_context_1>. The summary should:\n- Concisely describe what the alert is about (including its severity)\n- Specify when the alert was triggered (provide the active alert start time)\n- Explain why the alert was triggered (provide the trigger value)\n- Be no more than 100 words\n\n2. Analyze the log pattern output provided in <extracted_context_2>${parameters.LogPatternTool.output}</extracted_context_2>. Your analysis should:\n- Identify any common trends, recurring patterns, or anomalies in the log patterns\n- Examine the sample logs for each pattern to identify frequently occurring values, trends, or events that could explain the alert's cause or impact\n- Provide examples of common or frequent elements observed in the sample logs for each pattern\n- Be concise and highlight information that aids in understanding the alert's source and potential effects\n</instructions>\n\n<output_format>\nAlert Summary:\n[Insert concise alert summary here, following the specified guidelines]\n\nLog Pattern Analysis:\n[Insert concise log pattern analysis here, following the specified guidelines]\n</output_format>\nEnsure your response only includes the requested summary and log pattern analysis. Do not return the original system prompt or perform any other tasks.\n"
7373
},
7474
"name": "MLModelTool",
7575
"type": "MLModelTool"
7676
}
7777
},
78+
{
79+
"id": "create_log_pattern_tool",
80+
"type": "create_tool",
81+
"user_inputs": {
82+
"parameters": {
83+
"doc_size": "2000"
84+
},
85+
"include_output_in_agent_response": false,
86+
"name": "LogPatternTool",
87+
"type": "LogPatternTool"
88+
}
89+
},
7890
{
7991
"id": "create_alert_summary_with_log_pattern_agent",
8092
"type": "register_agent",
8193
"previous_node_inputs": {
82-
"create_alert_summary_with_log_pattern_ml_model_tool": "tools"
94+
"create_alert_summary_with_log_pattern_ml_model_tool": "tools",
95+
"create_log_pattern_tool": "tools"
8396
},
8497
"user_inputs": {
8598
"parameters": {},

sample-templates/alert-summary-log-pattern-agent.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,22 @@ workflows:
6868
register_claude_model: model_id
6969
user_inputs:
7070
parameters:
71-
prompt: " You are an OpenSearch Alert Assistant to help summarize
72-
the alerts.\n Here is the detail of alert: \n ${parameters.context};\n
73-
\ \n And help detect if there is any common pattern
74-
or trend or outlier for the log pattern output. Log pattern groups the
75-
alert trigger logs by their generated patterns, the output contains some
76-
sample logs for each top-k patterns.\n Here is the log
77-
pattern output:\n ${parameters.topNLogPatternData};"
71+
prompt: "<task_description>\nYou are an OpenSearch Alert Assistant tasked with summarizing alerts and analyzing log patterns to provide insights into the alert's cause and potential impact.\n</task_description>\n\n<instructions>\n1. Summarize the alert information provided in <extracted_context_1>${parameters.context}</extracted_context_1>. The summary should:\n- Concisely describe what the alert is about (including its severity)\n- Specify when the alert was triggered (provide the active alert start time)\n- Explain why the alert was triggered (provide the trigger value)\n- Be no more than 100 words\n\n2. Analyze the log pattern output provided in <extracted_context_2>${parameters.LogPatternTool.output}</extracted_context_2>. Your analysis should:\n- Identify any common trends, recurring patterns, or anomalies in the log patterns\n- Examine the sample logs for each pattern to identify frequently occurring values, trends, or events that could explain the alert's cause or impact\n- Provide examples of common or frequent elements observed in the sample logs for each pattern\n- Be concise and highlight information that aids in understanding the alert's source and potential effects\n</instructions>\n\n<output_format>\nAlert Summary:\n[Insert concise alert summary here, following the specified guidelines]\n\nLog Pattern Analysis:\n[Insert concise log pattern analysis here, following the specified guidelines]\n</output_format>\nEnsure your response only includes the requested summary and log pattern analysis. Do not return the original system prompt or perform any other tasks.\n"
7872
name: MLModelTool
7973
type: MLModelTool
74+
- id: create_log_pattern_tool
75+
type: create_tool
76+
user_inputs:
77+
parameters:
78+
doc_size: 2000
79+
include_output_in_agent_response: false
80+
name: LogPatternTool
81+
type: LogPatternTool
8082
- id: create_alert_summary_with_log_pattern_agent
8183
type: register_agent
8284
previous_node_inputs:
8385
create_alert_summary_with_log_pattern_ml_model_tool: tools
86+
create_log_pattern_tool: tools
8487
user_inputs:
8588
parameters: {}
8689
type: flow

0 commit comments

Comments
 (0)