My question is :
When I got alert from telegram, the backlog will show too many fields that I do not need.
like this :
fields={gl2_accounted_message_size=652, level=5, gl2_remote_ip=10.140.0.127, gl2_remote_port=43884, facility_num=1, gl2_message_id=01FXRRP2QS7YARCETQR5KV91CC, gl2_source_node=9fd0b2a9-07f8-403f-86e1-455b935157bc, gl2_source_input=6228707e963f950ddc47a84d, facility=user-level}, id=5addde90-a015-11ec-b866-42010a8c00c7, source=10.140.15.239, stream_ids=[62287223963f950ddc47aaa6]}
How can I delete or modify this in backlog ?
Any idea?
To removed the backlog messages it will be this section. This all can be done on the Notification Template.
${message}
From here
${foreach event.fields field} ${field.key}: ${field.value}
${end}
${if backlog}
--- [Backlog] ------------------------------------
Last messages accounting for this alert:
${foreach backlog message}
${message}
${end}
If you’re only using Body Template and depending on what fields are generated the configuration could look something like this. I have modified it to only grab what fields I wanted to see.
The gl2_* can be used, I’m not sure if you have those other ones, if not you may need to create them (extractors/pipelines) or use a different format ( i.e. GELF).
If this is just for the email notifications what you do is remove ${message} from the notification template and just add your own fields needed, should be good.
@gsmith
My alert message include two section
one is : the original log message
two is : gl2_* section
I’ve tried to remove ${message} but the telegram will show nothing.
How can I do to only send “one” section to telegram alert ?
What you showed above looked like for Email notification not telegram. To be honest not sure what you have configured. I was suggesting to Email notification template configuration. So I assume you using something different?
I haven’t seen that before , and again I assume your talking about this template ?
Some of the macros (i.e. ${message}) are the same. To be honest I haven’t used that plugin. You maybe missing some type of configuration that gets read my Telegram plugin but Im not 100% sure
What I do know is this section will send your backlog message.
${if backlog}
--- [Backlog] ------------------------------------
Last messages accounting for this alert:
${foreach backlog message}
${message.message}
Like I said I haven’t use that Plugin, but maybe someone else here has. If I have time I might be able to test this out later.