MessagePrefix


You can configure the agent to prefix a keyword or identifier for all messages. In the configuration file, you can add or modify the keyword or identifier with the MessagePrefix directive. If MessagePrefix is omitted, no prefix appears for the messages.

MessagePrefix is typically short, but can be up to 256 characters long. It can identify the platform or other characteristics of messages sent by the agent, which can be useful for correlating the message content.

The MessagePrefix content can contain environmental variable references, and date and time specifications.

Example

To prefix the local time of the machine and the machine name, use the following MessagePrefix value:

MessagePrefix %b %m %H:%M:%S %COMPUTERNAME%

This agent message conforms to the timestamp and host name header specifications suggested by RFC-3164 (Section 4.1.2).

The variables correspond to the following values:

  • %b—abbreviated month name at the at the current location
  • %m—month as a decimal number (01–12)
  • %H:%M:%S—time at the current location, represented as hours (00–23), minutes (00–59), and seconds (00–59)
  • %COMPUTERNAME(including the leading and trailing % characters)—an environmental variable

For a list of supported time specifications, see Special LogFile names.

Related topic


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*