Skip to content

Commit

Permalink
Missing macro annotations (#69)
Browse files Browse the repository at this point in the history
Fixes: #67 

Added some missing ${ } around some macro names.
  • Loading branch information
HofiOne authored May 30, 2024
2 parents bcfc068 + c1d47da commit 13b6a3d
Show file tree
Hide file tree
Showing 46 changed files with 126 additions and 126 deletions.
2 changes: 1 addition & 1 deletion _includes/doc/admin-guide/options/host-override.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
| Type: | string|
| Default: ||

*Description:* Replaces the ${HOST} part of the message with the
*Description:* Replaces the HOST part of the message with the
parameter string.
4 changes: 2 additions & 2 deletions _includes/doc/admin-guide/options/source-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
- *no-hostname*: Enable the no-hostname flag if the log message does
not include the hostname of the sender host. That way {{ site.product.short_name }}
assumes that the first part of the message header is ${PROGRAM}
instead of ${HOST}. For example:
assumes that the first part of the message header is PROGRAM
instead of HOST. For example:
```config
source s_dell {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ includes timezone information. That way you do not need to adjust the
recv-time-zone() parameter of syslog-ng.

If you want {{ site.product.short_name }} to output timestamps in Unix (POSIX) time format,
use the `S_UNIXTIME` and `R_UNIXTIME` macros. You do not need to
use the ${S_UNIXTIME} and ${R_UNIXTIME} macros. You do not need to
change any of the timezone related parameters, because the timestamp
information of incoming messages is converted to Unix time internally,
and Unix time is a timezone-independent time representation. (Actually,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ from syslogng import LogMessage
# Initialize an empty message with default values (recvd timestamp, rcptid, hostid, ...)
msg = LogMessage()

# Initialize a message and set its ${MESSAGE} field to the specified argument
# Initialize a message and set its MESSAGE field to the specified argument
msg = LogMessage("string or bytes-like object")
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Default value: .snmp. option.
*Description:* The snmptrap() source automatically parses the traps into
name-value pairs, so you can handle the content of the trap as a
structured message. Consequently, you might not even need the
`${MESSAGE}` part of the log message. If set-message-macro() is set to
**no**, {{ site.product.short_name }} leaves the `${MESSAGE}` part empty. If
MESSAGE part of the log message. If set-message-macro() is set to
**no**, {{ site.product.short_name }} leaves the MESSAGE part empty. If
set-message-macro() is set to **yes**, {{ site.product.short_name }} generates a regular
log message from the trap.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ command). Similar information is available for the
| ${.unix.exe} | The path of the executable belonging to the PID that sent the message. For example, /usr/bin/su |
| ${.unix.gid} | The group ID (GID) corresponding to the UID of the application that sent the log message. Note that this is the ID number of the group, not its human-readable name. For example, 0 |
| ${.unix.pid} | The process ID (PID) of the application that sent the log message. For example, 774. |
| | Note that on every UNIX platforms, if the system() source uses sockets, it will overwrite the PID macro with the value of ${.unix.pid}, if it is available. |
| | Note that on every UNIX platforms, if the system() source uses sockets, it will overwrite the ${PID} macro with the value of ${.unix.pid}, if it is available. |
| ${.unix.uid} | The user ID (UID) of the application that sent the log message. Note that this is the ID number of the user, not its human-readable name. For example, 0 |
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ destination d_riemann {
*Description:* The numeric value to add as the metric field of the
Riemann event. If possible, include type-hinting as well, otherwise the
Riemann server will interpret the value as a floating-point number. The
following example specifies the SEQNUM macro as an integer.
following example specifies the ${SEQNUM} macro as an integer.

```config
metric(int("${SEQNUM}"))
Expand Down
2 changes: 1 addition & 1 deletion doc/_admin-guide/070_Destinations/220_Riemann/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ riemann(

### Example: Using the riemann() driver

The following destination sends the value of the SEQNUM macro (the
The following destination sends the value of the ${SEQNUM} macro (the
number of messages sent to this destination) as a metric to the Riemann
server.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ the Cisco website.
## Parsing Cisco-specific message fields with patterndb
The ${PROGRAM} part of the syslog messages sent by Cisco devices
The PROGRAM part of the syslog messages sent by Cisco devices
contain not only the program name, but other important protocol
information part as well. The ${PROGRAM} of these messages contains the
information part as well. The PROGRAM of these messages contains the
Facility, Severity, and the Mnemonic (the Cisco name) of the message.
The following pattern database parses these values and makes them
available as the .cisco.Facility, .cisco.Severity, and .cisco.MsgName,
Expand Down
2 changes: 1 addition & 1 deletion doc/_admin-guide/070_Destinations/300_syslog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ destination d_syslog_tls {
```

**NOTE:** If a message uses the IETF-syslog format (RFC-5424), only the text
of the message can be customized (that is, the ${MESSAGE} part of the
of the message can be customized (that is, the MESSAGE part of the
log), the structure of the header is fixed.
{: .notice--info}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ log {

## Example: Using the drop-unmatched flag

In the following example, if a log message arrives whose ${MSG} part does
In the following example, if a log message arrives whose MSG part does
not contain the string foo, then {{ site.product.short_name }} will discard the message
and will not check compliance with the second if condition.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ id: adm-log-filters-inlist
in a file, allowing you to do simple, file-based black- and
whitelisting. The file must be a plain-text file, containing one entry
per line. The {{ site.product.short_name }} application loads the entire file, and
compares the value of the specified field (for example, ${PROGRAM}) to
compares the value of the specified field (for example, PROGRAM) to
entries in the file. When you use the in-list() filter, note the
following points:

Expand All @@ -25,7 +25,7 @@ Available in {{ site.product.short_name }} 3.5 and later.

## Example: Selecting messages using the in-list() filter

Create a text file that contains the programs (as in the ${PROGRAM}
Create a text file that contains the programs (as in the PROGRAM
field of their log messages) you want to select. For example, you want
to forward only the logs of a few applications from a host: kernel,
sshd, and sudo. Create the /etc/syslog-ng/programlist.list file with the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ id: adm-log-filters-match
*Synopsis:* match(regexp) \| match(regexp value(\"MACRO\")) \| match(regexp template(\"MACROS\"))

*Description:* Match a regular expression to the headers and the message
itself (that is, the values returned by the MSGHDR and MSG macros). Note
itself (that is, the values returned by the ${MSGHDR} and ${MSG} macros). Note
that in {{ site.product.short_name }} version 2.1 and earlier, the match() filter was
applied only to the text of the message, excluding the headers. This
functionality has been moved to the message() filter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ id: adm-log-filters-message
*Synopsis:* message(regexp)

*Description:* Match a regular expression to the text of the log
message, excluding the headers (that is, the value returned by the MSG
message, excluding the headers (that is, the value returned by the ${MSG}
macros). Note that in {{ site.product.short_name }} version 2.1 and earlier, this
functionality was performed by the match() filter.
8 changes: 4 additions & 4 deletions doc/_admin-guide/090_Global_options/000_Global_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ The following sub-options are available within the stats() option:

Available in {{ site.product.short_name }} 4.1 and later versions.

*Description:* Configures the behavior of counting messages based on different syslog fields, like SEVERITY, FACILITY, ${HOST}.
*Description:* Configures the behavior of counting messages based on different syslog fields, like SEVERITY, FACILITY, HOST.

Possible values:

Expand Down Expand Up @@ -510,12 +510,12 @@ restarts with 1).
is generated from the HOSTID and the RCPTID in the format of
HOSTID@RCPTID. It has a fixed length: 16+@+8 characters. You can
include the unique ID in the message by using the macro. For details,
see UNIQID.
see ${UNIQID}.

Enabling this option automatically generates the HOSTID. The HOSTID is a
persistent, 32-bits-long cryptographically secure pseudo random number,
that belongs to the host that the {{ site.product.short_name }} is running on. If the
persist file is damaged, the HOSTID might change.

Enabling this option automatically enables the RCPTID functionality. For
details, see RCPTID
Enabling this option automatically enables the ${RCPTID} functionality. For
details, see ${RCPTID}.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ syslog message, for example, to add elements of the message header to
the message text.

**NOTE:** If a message uses the IETF-syslog format (RFC-5424), only the text
of the message can be customized (that is, the ${MESSAGE} part of the
of the message can be customized (that is, the MESSAGE part of the
log), the structure of the header is fixed.
{: .notice--info}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,52 +33,52 @@ Alternatively, you can modify the timezone of the message using
timezone-specific rewrite rules. For details, see
Rewrite the timezone of a message.
Converting the timezone changes the values of the following date-related
macros (macros MSEC and USEC are not changed):
macros (macros ${MSEC} and ${USEC} are not changed):

- AMPM
- ${AMPM}

- DATE
- ${DATE}

- DAY
- ${DAY}

- FULLDATE
- ${FULLDATE}

- HOUR
- ${HOUR}

- HOUR12
- ${HOUR12}

- ISODATE
- ${ISODATE}

- ISOWEEK
- ${ISOWEEK}

- MIN
- ${MIN}

- MONTH
- ${MONTH}

- MONTH_ABBREV
- ${MONTH_ABBREV}

- MONTH_NAME
- ${MONTH_NAME}

- MONTH_WEEK
- ${MONTH_WEEK}

- SEC
- ${SEC}

- STAMP
- ${STAMP}

- TZ
- ${TZ}

- TZOFFSET
- ${TZOFFSET}

- UNIXTIME
- ${UNIXTIME}

- WEEK
- ${WEEK}

- WEEK_DAY
- ${WEEK_DAY}

- WEEK_DAY_ABBREV
- ${WEEK_DAY_ABBREV}

- WEEK_DAY_NAME
- ${WEEK_DAY_NAME}

- YEAR
- ${YEAR}

- YEAR_DAY
- ${YEAR_DAY}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ However, it is not possible to change the values of hard macros in
rewrite rules or via any other means.

The following macros in {{ site.product.short_name }} are hard macros and cannot be
modified: BSDTAG, CONTEXT\_ID, DATE, DAY, FACILITY\_NUM, FACILITY,
FULLDATE, HOUR, ISODATE, ISOWEEK, LEVEL\_NUM, LEVEL, MIN, MONTH\_ABBREV,
MONTH\_NAME, MONTH, MONTH\_WEEK, PRIORITY, PRI, RCPTID, SDATA, SEC,
SEQNUM, SOURCEIP, STAMP, TAG, TAGS, TZOFFSET, TZ, UNIXTIME,
WEEK\_DAY\_ABBREV, WEEK\_DAY\_NAME, WEEK\_DAY, WEEK, YEAR\_DAY, YEAR.
modified: ${BSDTAG}, ${CONTEXT_ID}, ${DATE}, ${DAY}, ${FACILITY_NUM}, ${FACILITY},
${FULLDATE}, ${HOUR}, ${ISODATE}, ${ISOWEEK}, ${LEVEL_NUM}, ${LEVEL}, ${MIN}, ${MONTH_ABBREV},
${MONTH_NAME}, ${MONTH}, ${MONTH_WEEK}, ${PRIORITY}, ${PRI}, ${RCPTID}, ${SDATA}, ${SEC},
${SEQNUM}, ${SOURCEIP}, ${STAMP}, ${TAG}, ${TAGS}, ${TZOFFSET}, ${TZ}, ${UNIXTIME},
${WEEK_DAY_ABBREV}, ${WEEK_DAY_NAME}, ${WEEK_DAY}, ${WEEK}, ${YEAR_DAY}, ${YEAR}.

The following macros can be modified:FULLHOST\_FROM, FULLHOST,
HOST\_FROM, HOST, LEGACY\_MSGHDR, MESSAGE, MSG,MSGID, MSGONLY, PID,
PROGRAM, SOURCE. Custom values created using rewrite rules or parsers
The following macros can be modified: ${FULLHOST_FROM}, ${FULLHOST},
${HOST_FROM}, ${HOST}, ${LEGACY_MSGHDR}, ${MESSAGE}, ${MSG}, ${MSGID}, ${MSGONLY}, ${PID},
${PROGRAM}, ${SOURCE}. Custom values created using rewrite rules or parsers
can be modified as well, just like stored matches of regular expressions
($0 \... $255).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: >-
>
> If you are using the flags(no-parse) option, then syslog message parsing is
> completely disabled, and the entire incoming message is treated as
> the ${MESSAGE} part of a syslog message.
> the MESSAGE part of a syslog message.
> In this case, {{ site.product.short_name }} generates a new syslog header
> (timestamp, host, and so on) automatically. Note that even
> though flags(no-parse) disables message parsing, some flags can
Expand Down Expand Up @@ -64,15 +64,15 @@ When used, the output specifies the local IP address of the
source from which the message originates.

For an example use case when using the macro is recommended, see
[[Example use case: using the ${DESTIP}, the ${DESTPORT}, and the ${PROTO} macros]]
Example use case: using the ${DESTIP}, the ${DESTPORT}, and the ${PROTO} macros

## ${DESTPORT}

When used, the output specifies the local port of the
source from which the message originates.

For an example use case when using the macro is recommended, see
[[Example use case: using the ${DESTIP}, the ${DESTPORT}, and the ${PROTO} macros]].
Example use case: using the ${DESTIP}, the ${DESTPORT}, and the ${PROTO} macros.

## ${FACILITY}

Expand Down Expand Up @@ -152,8 +152,8 @@ Available in 3.24 and later.

The priority (also called severity) of the message,
represented as a numeric value, for example, 3. For the textual
representation of this value, use the ${LEVEL} macro. See PRIORITY or
LEVEL for details.
representation of this value, use the ${LEVEL} macro. See ${PRIORITY} or
${LEVEL} for details.

## ${LOGHOST}

Expand All @@ -170,11 +170,11 @@ The hostname of the computer running {{ site.product.short_name }}.

Text contents of the log message without the program name
and pid. The program name and the pid together are available in the
MSGHDR and ${PID} macros.
${MSGHDR} and ${PID} macros.

If you are using the flags(no-parse) option, then syslog message parsing
is completely disabled, and the entire incoming message is treated as
the ${MESSAGE} part of a syslog message. In this case, {{ site.product.short_name }}
the MESSAGE part of a syslog message. In this case, {{ site.product.short_name }}
generates a new syslog header (timestamp, host, and so on)
automatically. Note that even though flags(no-parse) disables message
parsing, some flags can still be used, for example, the no-multi-line
Expand Down Expand Up @@ -372,7 +372,7 @@ one of the following:
IETF-syslog protocol (**${.SDATA.meta.sequenceId}**), and can
be added to BSD-syslog messages using the **${SEQNUM}** macro.

**NOTE:** If you need a sequence number for every log message that {{ site.product.short_name }} receives, use the RCPTID macro.
**NOTE:** If you need a sequence number for every log message that {{ site.product.short_name }} receives, use the ${RCPTID} macro.
{: .notice--info}

## ${SOURCE}
Expand Down Expand Up @@ -494,8 +494,8 @@ The day of the week as a numerical value (1-7).

## ${WEEKDAY}, ${C_WEEKDAY}, ${R_WEEKDAY}, ${S_WEEKDAY}

These macros are deprecated, use WEEK_DAY_ABBREV, R_WEEK_DAY_ABBREV,
S_WEEK_DAY_ABBREV instead. The 3-letter name of the day of week the
These macros are deprecated, use ${WEEK_DAY_ABBREV}, ${R_WEEK_DAY_ABBREV},
${S_WEEK_DAY_ABBREV} instead. The 3-letter name of the day of week the
message was sent, for example, Thu.

## ${WEEK_DAY_NAME}, ${C_WEEK_DAY_NAME}, ${R_WEEK_DAY_NAME}, ${S_WEEK_DAY_NAME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ To replace a part of the log message, you have to:

- select the field of the message that the rewrite rule should process

Substitution rules can operate on any soft macros, for example, MESSAGE,
PROGRAM, or any user-defined macros created using parsers. You can also
Substitution rules can operate on any soft macros, for example, ${MESSAGE},
${PROGRAM}, or any user-defined macros created using parsers. You can also
rewrite the structured-data fields of messages complying to the RFC-5424
(IETF-syslog) message format.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ id: adm-temp-facility
description: >-
It is possible to set the facility field with the set-facility() rewrite
function. When set, the set-facility() rewrite function will only
rewrite the ${PRIORITY} field in the message to the first parameter value
rewrite the PRIORITY field in the message to the first parameter value
specified in the function.
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ rewrite r_rewrite_set {
```

If you use the **${[email protected]}** macro in a
template or SQL table, its value will be that of the SOURCEIP macro (as
template or SQL table, its value will be that of the ${SOURCEIP} macro (as
seen on the machine where the SDATA field was created) for every message
that was processed with this rewrite rule, and empty for every other
message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ If you set drop-invalid() to **no**, the parsing error triggers
syslog-parser() to rewrite and extend the original log message with the
following additional information:

- It prepends the following message to the contents of the ${MESSAGE}
- It prepends the following message to the contents of the MESSAGE
field: Error processing log message.

- It sets the contents of the ${PROGRAM} field to syslog-ng.
- It sets the contents of the PROGRAM field to syslog-ng.

- It sets the contents of the facility field to syslog.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ are not permitted.

To parse key=value pairs, define a parser that has the kv-parser()
option. Defining the prefix is optional. By default, the parser will
process the ${MESSAGE} part of the log message. You can also define the
process the MESSAGE part of the log message. You can also define the
parser inline in the log path.

**Declaration**
Expand Down
Loading

0 comments on commit 13b6a3d

Please sign in to comment.