Skip to content

Endtime not working with alert_text_jinja and how to convert it to IST #342

Closed Locked Answered by jertel
firdausa-iprogrammer asked this question in Q&A
Discussion options

You must be logged in to vote

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:

{{ starttime.strftime('%Y-%m-%d %H:%M %z') }}

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.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@firdausa-iprogrammer
Comment options

@jertel
Comment options

@firdausa-iprogrammer
Comment options

@jertel
Comment options

@firdausa-iprogrammer
Comment options

Answer selected by firdausa-iprogrammer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants