elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

Force Elastalert to send mail in a specific font

Open Alexwii opened this issue 9 years ago • 18 comments

Hello everyone,

Thank you so much for Elastalert, it's beautifuf and very powerful.

I have a problem, when I want use "summary_table_fields" my mail look like this: tableau

And the problem it's that the font is not appropriate for the table.

It's not possible to specify at Elastalert to use a font like consolas ?

Thank you so much for your answer

Alexwii avatar Jan 16 '17 15:01 Alexwii

In my case Elastalert sends emails in the Text mode and i don't think you can force a specific font there.

  • See if you can change to html mode then you can set the font with css (you could do this with a custom alert https://elastalert.readthedocs.io/en/latest/recipes/adding_alerts.html)
  • Check if your email client has a setting for a default font. (this change will have to be done on all receivers)

AnderssonPeter avatar Jan 19 '17 07:01 AnderssonPeter

I will am create an alert in HTML, thank for your answer !

Alexwii avatar Jan 19 '17 08:01 Alexwii

@Alexwii if you do manage to create a html alerter please share it here in case someone else gets the same problem!

AnderssonPeter avatar Jan 19 '17 09:01 AnderssonPeter

Yes of course :)

Alexwii avatar Jan 19 '17 10:01 Alexwii

Could you share how you accomplished this? I have pretty much the same wish.

nejczupan avatar Apr 14 '17 17:04 nejczupan

I can, but it's not perfect, I should have work again on this. I post this when I think it will be ready but I have not time.

Alexwii avatar Apr 14 '17 22:04 Alexwii

I am trying to style my Elastalert alerts with html coding and I can't seem to get it working. @Alexwii did you mange to get your html code working?

LAChristopher avatar Jun 22 '17 15:06 LAChristopher

It's not perfect but it's works. But I need a little time for continue to perfect him.

Alexwii avatar Jun 28 '17 07:06 Alexwii

@Alexwii

Could you please share the example of html alert email rule ? And the output

sathishdsgithub avatar Jun 28 '17 08:06 sathishdsgithub

@Alexwii ah I understand. I haven't managed to get anything close to working though, if possible can you share your working code, even if not perfect; and I will also work on it to try help get it better.

LAChristopher avatar Jun 28 '17 08:06 LAChristopher

@sathishdsgithub I don't understand your question ? @LAChristopher Yes, if I have time today, I will upload it here

Alexwii avatar Jun 28 '17 08:06 Alexwii

@Alexwii thank you so much, really appreciate it.

LAChristopher avatar Jun 28 '17 08:06 LAChristopher

@Alexwii

Did you manage to get the proper format of the summary_table_field in email output? I'm also experiencing the same issue. My email output looks ugly, also I get more blank spaces in the bottom of the outlook email. summary_table

sathishdsgithub avatar Jul 21 '17 07:07 sathishdsgithub

Yes I fix it.

But I have not the time for share it here, because I need to write a documentation and I have a lot of work this month.

Maybe end of august... I'm sorry for that.

Alexwii avatar Jul 25 '17 07:07 Alexwii

@Alexwii

Thanks for the update. Meanwhile, could you please share at least the steps to get the proper output with creating an alert in HTML

sathishdsgithub avatar Jul 25 '17 08:07 sathishdsgithub

@LAChristopher @nejczupan @AnderssonPeter

For those looking for a decent table in email output, you can import the below alerts.py and give it a try. It gives a pretty table output. It uses the python from prettytable import PrettyTable https://github.com/qianghaohao/elastalert/blob/master/elastalert/alerts.py

Thanks to @qianghaohao for helping this accomplish.

sathishdsgithub avatar Aug 21 '17 11:08 sathishdsgithub

@sathishdsgithub thanks so much... will look into it. Really looking for how to change text, add logos, etc. Basically how to make the e-mail alert look good, so something that uses HTML code and not plain text.

LAChristopher avatar Aug 21 '17 11:08 LAChristopher

Guys check this issue: https://github.com/Yelp/elastalert/issues/391 It works pretty well for me. Hope it helps

YoavBZ avatar Sep 07 '17 16:09 YoavBZ