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.yearrather 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;loweroruppercontrolCharacters– handle control characters:escape,space, ordropsecurePath– create safe paths for dynafile templates;droporreplaceformat– 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 ofjsonfandjsonr
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-DATAfields.position.relativeToEnd– interpret positions relative to end of string (since 7.3.10)fixedWidth– pad string with spaces up toposition.towhen shorter;onoroff(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–EREorBREregex.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– forjsonfformat only; sets JSON data type. Rsyslog properties are strings, but some consuming systems require numbers or booleans.dataTypecontrols how thejsonffield is emitted. Supported values:number– emit numeric value, using 0 if emptystring– emit as string (default)auto– use number if integer, otherwise stringbool– emittrueunless value is empty or0
onEmpty– forjsonfformat 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.