# programname

Extracts the static program name portion from the syslog tag.

This property belongs to the Message Properties group.

Name:

  programname

Category:

  Message Properties

Type:

  string

## Description

The “static” part of the tag, as defined by BSD syslogd. For example, when TAG is “named[12345]”, programname is “named”.

Precisely, the programname is terminated by either (whichever occurs first):

- end of tag

- nonprintable character

- ‘:’

- ‘[’

- ‘/’

The above definition has been taken from the FreeBSD syslogd sources.

Please note that some applications include slashes in the static part of the tag, e.g. “app/foo[1234]”. In this case, programname is “app”. If they store an absolute path name like in “/app/foo[1234]”, programname will become empty (“”). If you need to actually store slashes as part of the programname, you can use the global option:

    global(parser.permitSlashInProgramName="on")

to permit this. Then, a syslogtag of “/app/foo[1234]” will result in programname being “/app/foo”. Note: this option is available starting at rsyslogd version 8.25.0.

## Usage

    template(name="example" type="list") {
        property(name="programname")
    }

## See also

See rsyslog Properties for the category overview.

Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project

Contributing: Source & docs: rsyslog source project

© 2008–2025 Rainer Gerhards and others. Licensed under the Apache License 2.0.