Property statement¶
Extracts and optionally transforms message properties. Supports substring, case, regex, JSON formatting, and more. .. summary-end
The property statement inserts property values. It can access any property and offers numerous options to select portions of a property or modify its text.
Parameters¶
name
– property to accessoutname
– output field name for structured outputsdateFormat
– date format for date-related properties. See property replacer for available formats. The property replacer documentation currently lists options for string templates. The names here omit thedate-
prefix (e.g.year
rather thandate-year
).To build custom formats, combine multiple property statements:
property(name="timereported" dateFormat="year") constant(value="-") property(name="timereported" dateFormat="month") constant(value="-") property(name="timereported" dateFormat="day")
date.inUTC
– show date in UTC. Available since 8.18.0.caseConversion
– convert text case;lower
orupper
controlCharacters
– handle control characters:escape
,space
, ordrop
securePath
– create safe paths for dynafile templates;drop
orreplace
format
– field format. Supported values:csv
– generate CSV datajson
– JSON-encode content without field headerjsonf
– complete JSON fieldjsonr
– avoid double escaping while keeping JSON safejsonfr
– combination ofjsonf
andjsonr
position.to
– end position. Since 8.2302.0, negative values strip characters from the end. For example,position.from="2" position.to="-1"
removes the first and last character. This is handy when removing surrounding characters such as brackets:property(name="msg" position.from="2" position.to="-1")
With an input of
[abc]
the result isabc
. This is especially useful when parsingSTRUCTURED-DATA
fields.position.relativeToEnd
– interpret positions relative to end of string (since 7.3.10)fixedWidth
– pad string with spaces up toposition.to
when shorter;on
oroff
(default) (since 8.13.0)compressSpace
– compress multiple spaces to one, applied after substring extraction (since 8.18.0)field.number
– select this field matchfield.delimiter
– decimal value of delimiter characterregex.expression
– regular expressionregex.type
–ERE
orBRE
regex.noMatchMode
– action when there is no matchregex.match
– match to useregex.subMatch
– submatch to usedropLastLf
– drop trailing LFmandatory
– ifon
, always emit field for structured outputs even when emptyspIfNo1stSp
– expert option for RFC3164 processingdataType
– forjsonf
format only; sets JSON data type. Rsyslog properties are strings, but some consuming systems require numbers or booleans.dataType
controls how thejsonf
field is emitted. Supported values:number
– emit numeric value, using 0 if emptystring
– emit as string (default)auto
– use number if integer, otherwise stringbool
– emittrue
unless value is empty or0
onEmpty
– forjsonf
format only; handling of empty values:keep
,skip
, ornull
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.