92 Commits

Author SHA1 Message Date
RJ Bergeron
32de3f6741 Now that we have the ordinal day, we can easily get the week of the year. Expose that. 2014-08-05 11:37:50 -04:00
RJ Bergeron
6d90af8739 Add support for day-of-year (ordinal day) time formatting 2014-08-05 11:37:20 -04:00
Rainer Gerhards
e3bcf3f0e8 add date-wday template option to complete date-related set
Was not requested, but makes sense to support it.
See also: https://github.com/rsyslog/rsyslog/issues/65
2014-04-30 11:47:47 +02:00
Rainer Gerhards
0ac1ce59dd add remaining template options for date extraction
see also: https://github.com/rsyslog/rsyslog/issues/65
2014-04-30 11:20:07 +02:00
Rainer Gerhards
25e8881d95 add date-wdayname property modifier
see also: https://github.com/rsyslog/rsyslog/issues/65
2014-04-29 13:13:51 +02:00
Nate Brown
1cd1ace0ff Adding two new format types to import raw json strings as is 2014-01-24 16:39:29 -08:00
Rainer Gerhards
94729cd9f9 refactor ExtendBuf() interface for iparams 2013-12-06 10:03:32 +01:00
Rainer Gerhards
01de5afe83 refactor strgen interface once again
as this provides more flexibility and potentially better performance. We
try to squeueze all interface changes into as early an release as
possible.
2013-12-06 09:52:03 +01:00
Rainer Gerhards
4695ab7c3e refactor output system string handling 2013-12-04 16:49:22 +01:00
Rainer Gerhards
69752635d2 refactor strgen interface 2013-12-04 11:55:36 +01:00
Rainer Gerhards
fb6dd02afc refactor milestone: create first PoC of commitTransaction() entry point 2013-12-04 11:38:07 +01:00
Rainer Gerhards
c0f4474389 refactor get.*PropVal() series of functions 2013-10-23 15:12:30 +02:00
Rainer Gerhards
7d39740b3d refactor: use common code for message property description processing
in all cases except script var access -- this comes next...
2013-10-22 17:55:35 +02:00
Rainer Gerhards
f4f2a493b0 work a bit toward string handling unification 2013-10-21 17:12:07 +02:00
hwoarang
1c71b9628b make rsyslog use the new json-c pkgconfig file if available 2013-09-03 11:38:01 +02:00
Rainer Gerhards
7b45d0b4d2 Merge branch 'v7-stable-info'
Conflicts:
	ChangeLog
	template.c
2013-03-29 16:09:19 +01:00
Rainer Gerhards
474877b9d7 permit substring extraction relative to end-of-string in templates 2013-03-29 16:04:21 +01:00
Rainer Gerhards
3421209cd5 optimize property replacer: reduce runtime for simple processing 2012-10-11 11:33:16 +02:00
Rainer Gerhards
f85690620b do "template date call" only when actually needed 2012-10-11 09:12:20 +02:00
Rainer Gerhards
dc724fcd2e optimize: do "template time() call" only once per batch
This still needs more optimizing as the call is very often
NOT needed - but we need to know about the templates in that
case.
2012-10-10 19:34:08 +02:00
Rainer Gerhards
037eaa0d69 new ruleengine: implement template type "subtree" 2012-09-18 11:32:45 +02:00
Rainer Gerhards
4bb35f1e94 Add missing prototype for tplToJSON() 2012-09-10 18:40:42 +02:00
Rainer Gerhards
0426ad7dd2 switch field default to "mandatory" and implement that mode 2012-08-30 18:56:23 +02:00
Miloslav Trmač
a73058031f Add support for optional fields 2012-08-29 16:07:23 +02:00
Rainer Gerhards
d18a93e943 default outname for $!<property> is now without $! prefix
also some type cleanup and simplification
2012-08-29 16:00:20 +02:00
Rainer Gerhards
3d56820f13 add capability to configure outname for constant (inside template)
also some cleanup
2012-08-25 19:21:12 +02:00
Rainer Gerhards
00c4f69c55 milestone: LIST-type templates support full option set 2012-08-25 19:08:07 +02:00
Rainer Gerhards
27a0078958 Merge branch 'master' into master-newtemplate 2012-08-25 12:27:06 +02:00
Rainer Gerhards
8939ccfffd Merge branch 'v5-stable' into v6-stable
Conflicts:
	ChangeLog
	action.c
	configure.ac
	doc/manual.html
	runtime/ruleset.c
	template.h
	threads.c
	tools/syslogd.c
2012-08-25 11:55:41 +02:00
Rainer Gerhards
0c65e62965 Merge branch 'v5-stable' of git+ssh://git.adiscon.com/git/rsyslog into v5-stable
Conflicts:
	template.c
2012-08-25 11:30:18 +02:00
Rainer Gerhards
1824ab8d98 change template.[ch] to ASL 2.0, removing a GPLv3-only patch
see template.c file header for details
Note that this functionality was almost never used in practice
2012-08-25 11:21:26 +02:00
Rainer Gerhards
1eac94e11d v6 config/templates: legacy types are now supported via template() 2012-08-25 11:08:38 +02:00
Rainer Gerhards
9801893b29 Merge branch 'v5-stable-field-substring' into v5-beta 2012-04-27 09:55:11 +02:00
Rainer Gerhards
9c76723c5b added capability to specify substrings for field extraction mode 2012-04-27 09:42:53 +02:00
Rainer Gerhards
5624012710 added capability to specify substrings for field extraction mode 2012-04-26 15:50:49 +02:00
Rainer Gerhards
7f0cd8c8b9 added the "jsonf" property replacer option (and fieldname) & bugfix
bugfix: property replacer option "json" could lead to content loss
        message was truncated if escaping was necessary
2012-04-19 15:20:16 +02:00
Rainer Gerhards
b88ba949f8 added "date-unixtimestamp" property replacer option to format as a unix timestamp 2012-03-29 18:04:12 +02:00
Rainer Gerhards
62b7a1b8a8 added "json" property replacer option 2012-03-16 08:21:12 +01:00
Rainer Gerhards
6db75eb0d2 cleanup: different text escape types made more portable 2012-01-19 15:07:25 +01:00
Rainer Gerhards
03be2fcd7c Merge branch 'v5-devel' into master
Conflicts:
	ChangeLog
	Makefile.am
	configure.ac
	doc/manual.html
	plugins/imptcp/imptcp.c
	plugins/imudp/imudp.c
	plugins/imuxsock/imuxsock.c
	runtime/parser.c
	template.c
	tools/omfwd.c
	tools/syslogd.c
2012-01-18 14:51:33 +01:00
Nathan Scott
052b1c7594 add JSON escaping option
Following the path taken by the two SQL formatting options,
which escape single quotes with double quotes (amongst other
things), this patch adds a JSON quoting option.  JSON is the
opposite to the SQL options, requiring double quotes to be
quoted within a string.  This patch provides a formatting
option implementing this requirement, while piggy-backing on
the existing code as much as possible.

Signed-off-by: Nathan Scott <nathans@aconex.com>
2012-01-17 10:29:02 +01:00
Rainer Gerhards
f72bde2f70 milestone: templates are now in config object 2011-04-19 09:43:36 +02:00
Rainer Gerhards
471f07f45a milestone: template supports CEE output via %$!all-json% 2010-12-01 10:19:50 +01:00
Rainer Gerhards
d9e64c16e5 finshed implementation of strgen modules
and also provided four build-in modules for the most common use
cases, hopefully resulting in a speedup of around 5% for typical
rsyslog processing.
2010-06-04 12:45:31 +02:00
Rainer Gerhards
527bfcea5c first implementation of strgen interface
and a first built-in strgen module. Some tweaks and more default strgens
are needed, but the code doesn't look too bad ;)
2010-06-01 18:51:55 +02:00
Rainer Gerhards
59227a8618 experimental commit: facility to generate template via C function
This was a test done to try to generate templates with C code, via
a new (potentially to-be-implemented) class of template modules. We have
a rough POC inside this code, and it showed around 5% or better speedup. So
it semms worth continuing in this direction.

Note that this experimental commit works correct, but does any
template in the form of

$template tpl,=somewhat

will lead to fixed template expansion based on the default file format.
2010-06-01 13:53:12 +02:00
Rainer Gerhards
b3c8528b50 added new property replacer option "date-rfc3164-buggyday"
primarily to ease migration from syslog-ng. See property replacer doc
for details.
2010-03-05 07:56:57 +01:00
Rainer Gerhards
7ea63db2f9 optimization: propert names are now internally identified by integers 2009-06-26 15:31:40 +02:00
Rainer Gerhards
3abf567d2b optimized template string generation 2009-06-19 16:07:17 +02:00
Rainer Gerhards
ec0e2c3e7d added a new way how output plugins may be passed parameters.
This is more efficient for some outputs. They new can receive fields not only
as a single string but rather in an array where each string is seperated.
2009-04-03 12:51:02 +02:00