Endtime not working with alert_text_jinja and how to convert it to IST #342
-
Hi Everyone, So there are 2 things I want to achieve in alert_text_jinja Could anyone help with both? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
I don't believe that endtime is available by default. As for formatting and timezone manipulation, each variable can be manipulated directly through method calls on that variables, or via Jinja filters. Ex:
I suggest reading up on Jinja to see what is possible. The alternative solution to both (i) and (ii) is to implement your own ElastAlert enhancement. Read up on how to do this here: https://elastalert2.readthedocs.io/en/latest/recipes/adding_enhancements.html With an enhancement you could populate a current time variable to be used as the endtime value, and also format the times to a specific timezone. |
Beta Was this translation helpful? Give feedback.
I don't believe that endtime is available by default.
As for formatting and timezone manipulation, each variable can be manipulated directly through method calls on that variables, or via Jinja filters. Ex:
I suggest reading up on Jinja to see what is possible.
The alternative solution to both (i) and (ii) is to implement your own ElastAlert enhancement. Read up on how to do this here: https://elastalert2.readthedocs.io/en/latest/recipes/adding_enhancements.html
With an enhancement you could populate a current time variable to be used as the endtime value, and also format the times to a specific timezone.