By default, a hostname is not included in the header part of the syslog message. This article shows a method where a hostname can be added in the syslog packet, as some syslog utilities require it.
Sample syslog configuration below will not include router's hostname in the header of the syslog message.
lab@m40e-re0> show configuration system sysloghost 200.100.1.1 { firewall any; interactive-commands any; facility-override local4;}
Nov 21 02:13:54 mgd[6543]: UI_CMDLINE_READ_LINE: User 'lab', command 'show interfaces terse '
A workaround is to use log-prefix in the configuration and set it to whatever text you want to add. It can be a hostname or any other prefix required by the design.
log-prefix
lab@Penelope-re0> show configuration system sysloghost 200.100.1.1 { firewall any; interactive-commands any; facility-override local4; log-prefix M40e-Sydney ;}
Message: Nov 21 01:41:28 M40e-Sydney : mgd[6543]: UI_CMDLINE_READ_LINE: User 'lab', command 'show interfaces terse '
2022-10-17: Article reviewed for accuracy; no changes required; article valid and relevant.2019-06-21: Content reviewed for accuracy. Log-prefix link added.