36 Commits

Author SHA1 Message Date
Stephen Workman
993f2ca187 Remove use of strftime(), for portability reasons. 2017-10-08 17:50:33 -04:00
Stephen Workman
7b5b6c2295 Use gmtime, and var2Number. 2017-10-05 21:31:26 -04:00
Stephen Workman
8d82d59343 Move formatting code to datetime.c, and update test. 2017-10-05 09:57:19 -04:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
Rainer Gerhards
8eea909367 imfile: add "readTimeout" parameter
closes https://github.com/rsyslog/rsyslog/issues/1133
2016-10-10 15:45:45 +02:00
Rainer Gerhards
0ab2ba2ff2 add template option "date-utc" to emit time in UTC
closes https://github.com/rsyslog/rsyslog/issues/730
2016-03-22 12:27:39 +01:00
Rainer Gerhards
e8c8e96e27 refactor time-obtaining functions so that the can obtain time in UTC
This works where the time is picked up locally.
2016-01-11 18:52:42 +01:00
Rainer Gerhards
3454658803 pmrfc3164: add capability to accept year after time in timestamp
This is done by Aruba Networks equipment.
2015-04-20 11:52:29 +02:00
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
ff2ec4001f Merge branch 'v8-stable-newparsers' 2014-07-08 16:17:15 +02:00
Rainer Gerhards
4da700873e pmciscoiso: support Nexus TZ string in date (but right now ignore it)
This does not longer give a parsing error, however, no information is right
now obtained from that TZ string.
2014-07-08 15:51:52 +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
Rainer Gerhards
177c77ca1e apply default TZ if none is present in legacy timestamp 2013-09-02 11:55:51 +02:00
Rainer Gerhards
2fbac28d3c ommongodb: now writes a real timestamp into mongo 2012-03-30 09:55:45 +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
ac9afc4149 Merge branch 'v5-stable' into master
Conflicts:
	ChangeLog
	action.h
	configure.ac
	doc/manual.html
	plugins/immark/immark.c
	plugins/impstats/impstats.c
	plugins/imptcp/imptcp.c
	plugins/imtcp/imtcp.c
	runtime/cfsysline.c
	runtime/cfsysline.h
	runtime/conf.c
	runtime/ctok.c
	runtime/ctok.h
	runtime/ctok_token.c
	runtime/ctok_token.h
	runtime/dnscache.h
	runtime/expr.c
	runtime/expr.h
	runtime/rule.c
	runtime/rule.h
	runtime/ruleset.h
	runtime/sysvar.c
	runtime/vm.h
	runtime/vmop.c
	runtime/vmop.h
	runtime/vmprg.c
	runtime/vmprg.h
	runtime/vmstk.c
	runtime/vmstk.h
	tools/omusrmsg.c
2012-01-18 14:08:24 +01:00
Rainer Gerhards
18e60f46a1 Merge branch 'v4-stable' into v5-stable
Conflicts:
	runtime/debug.h
	runtime/obj.c
	runtime/parser.h
	runtime/wti.h
2012-01-16 16:14:30 +01:00
Rainer Gerhards
f6dea36394 runtime license change 2012-01-16 12:39:01 +01:00
Rainer Gerhards
d5f78989d8 added support for obtaining timestamp from system for imuxsock
This permits to read the time a message was submitted to the system
log socket. Most importantly, this is provided in microsecond resolution.
So we are able to obtain high precision timestampis even for messages
that were - as is usual - not formatted with them. This also simplifies
things in regard to local time calculation in chroot environments.
Many thanks to Lennart Poettering for suggesting this feature,
providing some guidance on implementing it and coordinating getting the
necessary support into the Linux kernel.
2011-06-20 12:19:15 +02:00
Dražen Kačar
7052d3c378 bugfix: fixed compile problem due to empty structs
this occured only on some platforms/compilers. thanks to Dražen Kačar
for the fix

Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2011-02-16 18:20:59 +01:00
Rainer Gerhards
de7726cbf0 Merge branch 'v4-stable' into v5-stable
Conflicts:
	ChangeLog
	runtime/datetime.h
2010-03-09 09:15:14 +01:00
Rainer Gerhards
d97ad63e21 added new property replacer option "date-rfc3164-buggyday"
primarily to ease migration from syslog-ng. See property replacer doc for
details. [backport from 5.5.3 because urgently needed by some]
2010-03-08 17:56:11 +01:00
Rainer Gerhards
8b246de2a5 some light performance enhancement
...by replacing time() call with much faster (at least under linux)
gettimeofday() calls.
2009-11-12 17:12:10 +01:00
Rainer Gerhards
176f773a2e Merge branch 'v4-stable' into v4-beta & BUGFIX
Conflicts:
	configure.ac
	doc/manual.html
	runtime/datetime.h
	runtime/parser.c
	runtime/rsyslog.h
	tools/syslogd.c

v4-stable had a bug with RFC5424-formatted structured data, which showed
was detected by the enhanced automatted testbench of v4-beta.
2009-10-01 16:30:32 +02:00
Rainer Gerhards
37ba1df6e3 bugfix: random data could be appended to message, possibly causing segfaults 2009-09-24 09:48:38 +02:00
Rainer Gerhards
de84a12f8a introduced the idea of detached properties
some things inside the message can be used over a large number of
messages and need to to be allocated and re-written every time. I now
begin to implement this as a "prop_t" object, first use for the inputName.
Some input modules are already converted, some others to go. Will do
a little performance check on the new method before I go further.

Also, this commit has some cleanup and a few bug fixes that prevented
compiliation in debug mode (I overlooked this as I did not compile
for debug, what I normally do, and the automatted test also does not
do that)
2009-06-29 16:53:26 +02:00
Rainer Gerhards
46435e2c3b cleanup (removed now-unused parameters) 2009-06-25 15:33:49 +02:00
Rainer Gerhards
221dc8a322 some more optimizations of the msg_t object (minor) 2009-06-22 18:19:10 +02:00
Rainer Gerhards
aba90e8248 added capability to run multiple tcp listeners (on different ports)
Well, actually this and a lot of related things. I improved the
testbench so that the new capabilities are automatically tested and
also did some general cleanup. The current multiple tcp listener
solution will probably receive some further cleanup, too, but looks
quite OK so far. I also reviewed the way tcpsrv et all work, in
preparation of using this code for imdiag. I need to document the
findings, especially as the code is rather complicated "thanks" to
the combination of plain tcp and gssapi transport modes.
2009-05-22 17:06:52 +02:00
Rainer Gerhards
8528344ef5 "output" timestamp now taken from mesg's time generated
This enhances performance and, as some have pointed out, is
probably also more consistent with what users expect how
the various output-timestamp related function should work. This
commit needs some more testing.
2008-10-07 14:26:41 +02:00
Rainer Gerhards
760e5f0d39 performance optimization: unnecessary time() calls during message parsing removed
thanks to David Lang for his excellent performance analysis
2008-09-16 11:56:07 +02:00
Rainer Gerhards
63994d092c Merge branch 'v3-stable' into beta
Conflicts:

	runtime/datetime.h
	runtime/rsyslog.h
2008-09-12 15:11:38 +02:00
Rainer Gerhards
d451808236 reduced number of compile warnings in -pedantic gcc mode 2008-06-27 10:10:47 +02:00
Rainer Gerhards
2687d0010c added new property replacer option "time-subseconds"
enables to query just the subsecond part of a high-precision timestamp
2008-06-06 17:33:58 +02:00
Rainer Gerhards
8f8f65abb6 moved files to the runtime
there are still some files left which could go into the
runtime, but I think we will delete most of them once we
are done with the full modularization.
2008-04-16 10:26:54 +02:00