Mailing List Archive

syslogtag: only log daemon name, without the [pid]
Hello,

I have defined my own template for logging:

$template long-iso,"%$NOW% %timereported:8:15% %syslogtag% %msg%\n"

Which logs in following format:

2021-08-14 05:55:31 sshd[1856]: message

How can I make the %syslogtag% to only log daemon name, without the
[pid] part ?

I am using rsyslog 8.1901 on Debian 10

thank you,

_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
Re: syslogtag: only log daemon name, without the [pid] [ In reply to ]
change syslogtag to programname (and you may need to add a : after the vriable)

David Lang

On Sat, 14 Aug 2021, Fourhundred Thecat via rsyslog wrote:

> Date: Sat, 14 Aug 2021 06:17:23 +0200
> From: Fourhundred Thecat via rsyslog <rsyslog@lists.adiscon.com>
> To: rsyslog@lists.adiscon.com
> Cc: Fourhundred Thecat <400thecat@gmx.ch>
> Subject: [rsyslog] syslogtag: only log daemon name, without the [pid]
>
> Hello,
>
> I have defined my own template for logging:
>
> $template long-iso,"%$NOW% %timereported:8:15% %syslogtag% %msg%\n"
>
> Which logs in following format:
>
> 2021-08-14 05:55:31 sshd[1856]: message
>
> How can I make the %syslogtag% to only log daemon name, without the
> [pid] part ?
>
> I am using rsyslog 8.1901 on Debian 10
>
> thank you,
>
> _______________________________________________
> rsyslog mailing list
> https://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
> What's up with rsyslog? Follow https://twitter.com/rgerhards
> NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of
> sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T
> LIKE THAT.
>
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.