Add template files #1110
Replies: 1 comment
-
It's an interesting idea. It could be an involved PR but provided it doesn't break existing users, and all new code has unit tests and documentation provided, as well as meets the project's other contribution guidelines (link in #11) then I don't see a reason why we wouldn't want to include it. Keep in mind that many ElastAlert 2 users run in Docker / Kubernetes so the implementation should be capable of supporting that. I doubt it would be a problem but just something to keep in mind with your implementation. I'm not deeply familiar with the Jinja internals so you'd also want to review their docs to make sure there's no memory leak risk. For example, if every alert caused a file template to be loaded / duplicated in memory, then that would need to be addressed. |
Beta Was this translation helpful? Give feedback.
-
Hi!
I'm testing ElastAlert to send some aggregated data that we're currently sending via some ad-hoc scripts.
The rules engine is more than enough for our use cases, but I find the templating somewhat limiting. Our use cases involve sending Adaptive Cards (via Ms Teams and email) that include conditional elements based on the data received and the recipients.
We already have a collection of templates with
include
s and macros for these cases, so I thought of adapting the ElastAlert templating system to include file paths. My idea is that whenalert_text_type: alert_text_jinja
,alert_text
can receive, in addition to an in-line template, a path relative to atemplates
folder (or an absolute path).Would you be willing to accept such a PR? Any suggestions on the implementation?
Regards!
Beta Was this translation helpful? Give feedback.
All reactions