Skip to content

Commit b6ffa3c

Browse files
authoredApr 2, 2025··
$(format-date) (#182)
Added the $(format-date) template function.
2 parents d2d4435 + 5e84b67 commit b6ffa3c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎doc/_admin-guide/110_Template_and_rewrite/000_Customize_message_format/007_Template_functions_of_syslog-ng.md

+10
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@ compiled with JSON support, execute the **syslog-ng \--version**
155155
command.
156156
{: .notice--info}
157157

158+
## $(format-date)
159+
160+
|*Syntax:*|$(format-date parameters)|
161+
162+
*Description:* The `$(format-date)` template function takes a timestamp in the `DATETIME` representation and formats it according to an `strftime()` format string. The `DATETIME` representation in syslog-ng is a UNIX timestamp formatted as a decimal number, with an optional fractional part, where the seconds and the fraction of seconds are separated by a dot. You can use the `--time-zone` option to override the original timestamp.
163+
164+
```config
165+
$(format-date [options] format-string [timestamp])
166+
```
167+
158168
## $(format-ewmm)
159169

160170
|*Syntax:*|$(format-ewmm)|

0 commit comments

Comments
 (0)
Please sign in to comment.