80 Commits

Author SHA1 Message Date
Rainer Gerhards
17a39a3e9a fix build issue on raspbian 2017-12-08 13:38:57 +00:00
Stephen Workman
0ff332ab87 Remove NULL checks. 2017-10-11 17:19:34 -04:00
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
aaaf5aa51b Fix incorrect return value. 2017-10-05 10:14:25 -04:00
Stephen Workman
8d82d59343 Move formatting code to datetime.c, and update test. 2017-10-05 09:57:19 -04:00
Rainer Gerhards
8d67c03d45 solaris: fix coding issues 2017-04-11 10:18:42 +02:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
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
bbcbb03c64 fix compiler warnings 2016-07-22 15:00:28 +02:00
Rainer Gerhards
8a8675b223 fix compiler warnings 2016-06-02 10:18:05 +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
210032b2a0 bugfix: "date-ordinal" could cause segfault for invalid date
The input parsers guard against this condition, however, it
can occur on the "timegenerated" property if the local
system time is misconfigured to a date outside the
valid range.
2016-03-03 13:59:54 +01:00
Rainer Gerhards
5cb41f7483 timestamp handling: guard against invalid dates
We do not permit dates outside of the year 1970..2100
interval. Note that network-receivers do already guard
against this, so the new guard only guards against invalid
system time. Still good to have (especially when things are
extended...)
2016-03-02 15:58:18 +01:00
Rainer Gerhards
b40214767d doc: describe why we cannot use mktime()
... as a souce code comment at the right place.
2016-03-02 12:41:57 +01:00
Rainer Gerhards
ffb321f169 bugfix: unixtimestamp was incorrectly computed
The problem happened in leap year from March til then end
of year and healed itself at the begining of the next year.
During the problem period, the timestamp was 24 hours too
low.

This is primarily a simple fix that can also be applied to
older rsyslog versions. However, we will see if we can
refactor the code to make use of mktime(). Originally, that
was not done for some issues seen, which may no longer
apply.

fixes https://github.com/rsyslog/rsyslog/issues/830
2016-03-02 11:43:09 +01:00
Rainer Gerhards
4d73026d0f add UTC-version of $NOW family of system properties 2016-01-12 12:09:03 +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
Rainer Gerhards
b10009a918 remove no longer needed variable 2014-11-01 17:21:16 +01:00
RJ Bergeron
9cf7949bb6 convert getOrdinal to table lookup as well. 2014-08-07 23:39:17 -04:00
RJ Bergeron
7f6c72a217 Refactor unix time_t code with a giant table lookup :) 2014-08-07 23:39:06 -04: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
56b17e6a81 make datetime parser use new tzinfo infrastructure
also do some additons/modifications to infrastructure
2014-07-09 19:34:12 +02:00
Rainer Gerhards
ff2ec4001f Merge branch 'v8-stable-newparsers' 2014-07-08 16:17:15 +02:00
Rainer Gerhards
fb8a634cf4 pmciscoios: hardcode some time zone offsets 2014-07-08 16:09:40 +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
b0f698bad6 support prepended year in RFC3164 timestamp
again, regression potential is extremely slim. this is done e.g.
by Brocade devices. Note that the timestamp must contain only
ONE year (either in front or after month/day). If two are present,
it is flagged invalid (what it obviously really is).
2014-07-04 05:23:24 +02:00
Rainer Gerhards
146656700a support fractional seconds in RFC3164 timestamp
regression potential is minimal and this happens frequently
enough in practice to become part of the heuristic
2014-07-04 04:44:33 +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
Rainer Gerhards
177c77ca1e apply default TZ if none is present in legacy timestamp 2013-09-02 11:55:51 +02:00
Rainer Gerhards
227d8faed2 optimize: slight improvement due to isdigit() replacement 2013-01-14 16:18:46 +01:00
Rainer Gerhards
88020b001b Merge branch 'v5-stable' into v7-stable 2013-01-14 08:40:33 +01:00
Tomas Heinrich
8433d88b48 bugfix: decrement string length 2013-01-14 08:38:46 +01:00
David Hill
5c9fd7c96f bugfix: timeval2syslogTime cause problems on some platforms
...due to invalid assumption on structure data types.
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=394
2013-01-08 09:30:56 +01:00
Rainer Gerhards
77cf82011e Merge branch 'v6-stable' into v7-stable 2012-12-13 18:24:29 +01:00
Rainer Gerhards
b96693cef7 Merge branch 'v5-stable' into v6-stable
Conflicts:
	ChangeLog
2012-12-13 18:24:19 +01:00
Scott Severtson
153998322b bugfix: invalid DST handling under Solaris 2012-12-13 18:22:38 +01:00
Rainer Gerhards
7182c6def3 silence compiler warnings
the changes do not affect actual code execution, just keep the
compile log clean.
2012-11-30 12:57:26 +01: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
abb381b8a5 Merge branch 'v5-stable-newstats' into v5-devel
Conflicts:
	plugins/imtcp/imtcp.c
2012-01-16 17:04:10 +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
31900e004b more cleanup... 2011-07-11 15:36:05 +02: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
Rainer Gerhards
b3dae5cff3 Merge branch 'v4-stable' into v5-stable 2011-06-16 18:02:13 +02:00