Go to main content

man pages section 1M: System Administration Commands

Exit Print View

Updated: July 2017
 
 

msgid(1M)

Name

msgid - generate message IDs

Synopsis

/usr/sbin/msgid 

Description

The msgid utility generates message IDs.

A message ID is a numeric identifier that uniquely identifies a message. Although the probability of two distinct messages having the same ID is high, this can be greatly reduced with the appropriate priority or facility.level designator (see syslogd(1M)). Specifically, the message ID is a hash signature on the message's unexpanded format string, generated by STRLOG_MAKE_MSGID() as defined in <sys/strlog.h>.

syslogd(1M) is a simple filter that takes strings as input and produces those same strings, preceded by their message IDs, as output. Every message logged by syslogd(1M) includes the message ID. The message ID is intended to serve as a small, language-independent identifier.

Examples

Example 1 Using the msgid command to generate a message ID

The following example uses the msgid command to generate a message ID for the echo command.

example# echo hello | msgid
205790 hello
example#
Example 2 Using the msgid command to Generate a Message Catalog

The following example uses the msgid command to enumerate all of the messages in the binary zfs, on an x86 machine, to generate a message catalog.

example# strings /kernel/fs/amd64/zfs | msgid
...
726970 stride_hits
766819 stride_misses
929857 reclaim_successes
412490 reclaim_failures
234331 streams_resets
737841 streams_noresets
471619 bogus_streams
878613 onloan_read_buf
...

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os

See Also

syslogd(1M), attributes(5), log(7D)