You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some digging through the source code of elastalert2 and experimentation, it works with the following rule settings:
jinja_template_path: config/jinja_template.txt
Using the relative path (considering the working directory set by the systemd unit file) it works. However for a regular user it is not very intuitive to set the jinja_template_path to a relative path and the documentation doesn't mention it.
The text was updated successfully, but these errors were encountered:
Yes, it requires relative paths. I've updated the documentation to reflect this. We cannot change it to use absolute paths since it will break existing users configurations. However, if you're interested in adding an additional field named jinja_template_base_path then that value could allow users to change the behavior:
jinja_template_base_path: "" => Templates will be provided via relative paths under the current working directory (existing default behavior)
jinja_template_base_path: "/" => Templates will be provided via absolute paths
jinja_template_base_path: "/some/other/path" => Templates will be provided via relative paths under the given parent directory
The value would be supplied on line 149 of loaders.py.
This issue is stale because it has been open for 6 months with no activity. Stale issues convey that the issue, while important to someone, is not critical enough for the author, or other community members to work on, sponsor, or otherwise shepherd the issue through to a resolution.
Hi,
using
elastalert2==2.15.0
we encountered an error with jinja2 absolute template path not working:It raises the following exception:
Elastalert is installed like this:
python3 -m venv /opt/elastalert/venv source /opt/elastalert/venv/bin/activate pip install elastalert2
And used with custom systemd unit file:
After some digging through the source code of elastalert2 and experimentation, it works with the following rule settings:
Using the relative path (considering the working directory set by the systemd unit file) it works. However for a regular user it is not very intuitive to set the
jinja_template_path
to a relative path and the documentation doesn't mention it.The text was updated successfully, but these errors were encountered: