alert_text adds additional new line at the end
When alerting rule to HipChat room, new line is pasted at the end.
How to get rid of it?
Is this caused by the link at the end of statement?
P.S. alert_text: "{0}: At least {1} events occurred for host {2} link"
seems this is caused due to _ensure_new_line method in alerts.py
https://github.com/Yelp/elastalert/blob/master/elastalert/alerts.py#L49
but I don't understand why it is needed to call it here - https://github.com/Yelp/elastalert/blob/master/elastalert/alerts.py#L134
In this case if alert_text_only message consists of one row - it adds empty new line after body message.
This is one of those things that makes sense for some alerters but not for others. I'd probably like to see the newline kept in the generic alert text generator, but have each alerter strip it off if necessary. Hipchat, Slack, Pagerduty, others, seem like good candidates. I'm willing to take a PR on this, otherwise it's not very high priority.
@Qmando
I also observe multiple new lines at the end of my email output. I'm using summary_table_fields for alert_text: output . Are there any options to ignore these new lines in my email output?
alert_text_type: alert_text_only
alert_text: |
summary_table_fields:
- field 1
- field 2