112 Commits

Author SHA1 Message Date
Rainer Gerhards
2af5c24d2d
Merge pull request #2285 from PascalWithopf/line_length_correction
codestyle: partially reduce line length to 120
2017-12-21 18:54:10 +01:00
PascalWithopf
29c9fb1f9a codestyle: reduce line length to 120
lines are still checked for a length of 125 because
these are just some of the lines
2017-12-21 17:09:32 +01:00
Rainer Gerhards
48ffcacc14 imklog: local host IP was hardcoded to 127.0.0.1
This is now taken from the global localHostIP setting, which is used
consistent accross all modules.

Also, the removed (2012?) directive $klogLocalIPIF has been added
again but directly marked as removed. That way, an informative error
message is generated if someone tries to use it.

closes https://github.com/rsyslog/rsyslog/issues/2276
2017-12-21 14:33:46 +01:00
Trent Piepho
5c35619385 imklog: Fix permitnonkernelfacility not working
permitnonkernelfacility doesn't work when the new configuration syntax
is used, e.g. 'module(load="imklog" permitnonkernelfacility="on")'.
It does work with the old syntax, e.g. '$KLogPermitNonKernelFacility
on'

This is because the old style config is stored in a static global
struct "cs", while the new style config is passed in as a pointer.
Code in imklog will put old style config entries into the new config
struct, and almost all the code in imklog uses the new config struct
like it should.  Except for a check for bPermitNonKernel in Syslog()
that continued to use the static global that only has old style
configs.

Fix this by passing pModConf down into Syslog() and using that in
place of the static global.

closes https://github.com/rsyslog/rsyslog/issues/477
2017-07-18 14:31:29 +02:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Rainer Gerhards
448f16495c remove "inline" attribute from excessivly long functions 2016-10-26 11:50:15 +02:00
Rainer Gerhards
5e3b075d53 fix compiler warnings 2016-06-02 12:08:55 +02: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
Peter Portante
2470f0f72b Remove use of sizeof(char) and sizeof(uchar)
Remove the use sizeof(char) or sizeof(uchar) in calculations for memory
allocation or string length.  There are no known platforms for which
sizeof(char) or sizeof(uchar) is not 1, and c99 has defined sizeof(char)
to be 1 (section 6.5.3.4 of c99).
2015-12-16 02:18:45 +00:00
Paul Donohue
244d365f21 bugfix imklog: infinite loop on OpenVZ VMs 2015-01-08 16:16:12 -05:00
Rainer Gerhards
a407348963 refactor PRI-handling code 2014-10-08 12:50:10 +02:00
Rainer Gerhards
1ac20ffe97 Merge branch 'v5-stable-prifix' into v7-stable-prifix
Conflicts:
	plugins/imklog/imklog.c
	plugins/imtemplate/imtemplate.c
	plugins/imuxsock/imuxsock.c
	runtime/msg.c
	runtime/rsyslog.h
	runtime/rule.c
	runtime/syslogd-types.h
	tools/syslogd.c
2014-09-16 14:48:29 +02:00
Rainer Gerhards
df4e90f602 Merge branch 'v5.8.13-prifix' into v5-stable-prifix
Conflicts:
	plugins/imklog/imklog.c
	plugins/imklog/ksym.c
	runtime/rule.c
2014-09-16 12:43:29 +02:00
Rainer Gerhards
2a9f4e6030 Merge branch 'v5.8.6-prifix' into v5.8.13-prifix
Conflicts:
	plugins/imklog/imklog.c
2014-09-16 12:11:09 +02:00
Rainer Gerhards
20a8056ac7 fix compile problems and cleanup
most importantly, we do no longer use the LOG_FAC() and LOG_PRI() macro
names, which may conflict with systems names and may act other than
expected by a user.
2014-09-16 11:46:41 +02:00
Rainer Gerhards
42cd1fa7d7 Merge branch 'v7-stable'
Conflicts:
	configure.ac
	doc/manual.html
	plugins/imfile/imfile.c
	plugins/imklog/bsd.c
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
2012-11-22 11:05:45 +01:00
Rainer Gerhards
ae7b78cdb2 imklog: add new config params to module() parameter set
This is based on Marius Tomaschewski's set of patches, mostly
just applied manually (as I need to mangle with the merge).
2012-11-22 10:08:43 +01:00
Rainer Gerhards
84a5d7b138 Merge branch 'v5-stable' into v6-stable
Note: this was not a simple merge, I rather needed to adopt the v5 code to
the new v6 config handling. However, no v6 config format has been added yet
(this is the next step).

Conflicts:
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
2012-11-22 09:45:05 +01:00
Marius Tomaschewski
f040bde7a0 imklog: added $klogParseKernelTimestamp option
When enabled, kernel message [timestamp] is converted for message time.
Default is to use receive time as in 5.8.x and before, because the clock
used to create the timestamp is not supposed to be as accurate as the
monotonic clock (depends on hardware and kernel) resulting in differences
between kernel and system messages which occurred at same time.
2012-11-21 18:15:00 +01:00
Marius Tomaschewski
318a6fb577 imklog: added $klogKeepKernelTimestamp option
When enabled, the kernel [timestamp] remains at begin of
each message, even it is used for the message time too.
2012-11-21 18:13:48 +01:00
Rainer Gerhards
a7c5807346 imklog, impstats: support for new rate-limiting API added 2012-10-19 10:03:30 +02:00
Rainer Gerhards
fa4119e874 imklog: add paramter "keepkerneltimestamp"
Thanks to Marius Tomaschweski for the suggestion and a patch (for v5)
that this commit bases on.
2012-10-17 17:17:43 +02:00
Rainer Gerhards
5a993ad742 imklog: removal of no longer needed config directives 2012-06-29 12:59:46 +02:00
Rainer Gerhards
8e8b77c7ef Merge branch 'beta' into master-module
Conflicts:
	ChangeLog
	configure.ac
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
2012-06-29 12:54:49 +02:00
Rainer Gerhards
99e4bbc0e4 imklog: cleanup of no longer used code 2012-06-29 12:47:13 +02:00
Rainer Gerhards
cb2a78b30b imklog: support for module() global config parameters added 2012-06-29 12:42:08 +02:00
Rainer Gerhards
9ec02e670a cleanup: removed unused but set parameters 2012-04-23 17:31:26 +02:00
Rainer Gerhards
d6da57ae03 Merge branch 'v5-stable-newstats'
Conflicts:
	action.c
	configure.ac
	doc/imuxsock.html
	plugins/imklog/imklog.c
	plugins/imptcp/imptcp.c
	plugins/imtcp/imtcp.c
	plugins/imudp/imudp.c
	plugins/imuxsock/imuxsock.c
	runtime/glbl.c
	runtime/glbl.h
	runtime/net.c
	runtime/ruleset.c
	tcpsrv.h
	tools/syslogd.c
2012-04-07 15:42:46 +02:00
Rainer Gerhards
d53016962d Merge branch 'v5-stable-newstats' into v5-devel
Conflicts:
	configure.ac
	doc/manual.html
2012-04-07 14:44:12 +02:00
Rainer Gerhards
1d6d534df2 unified use of $LocalHostIPIF among all locally-emitting inputs
with the exception of imdiag, which I humbly do not think needs this
capabilit (even counter-productive for testbench use).
2012-03-22 16:06:57 +01:00
Rainer Gerhards
f90675f33f Merge branch 'v5-stable-newstats' into v5-devel
Conflicts:
	ChangeLog
	action.c
	configure.ac
	doc/imuxsock.html
	doc/manual.html
	runtime/queue.c
2012-03-12 17:00:21 +01:00
Rainer Gerhards
50a94aa1c7 added capability to use a local interface IP address as fromhost-ip for imklog 2012-03-10 18:29:40 +01:00
Rainer Gerhards
16811e2f38 Merge branch 'v6-stable' 2012-03-01 12:29:19 +01:00
Rainer Gerhards
115718de96 Merge branch 'v5-stable' into v5-devel
Conflicts:
	ChangeLog
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
2012-03-01 12:25:39 +01:00
Rainer Gerhards
c2970de8b0 bugfix: imklog invalidly computed facility and severity
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313
2012-03-01 12:19:32 +01:00
Rainer Gerhards
aafa9b41a5 bugfix: imklog invalidly computed facility and severity
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313
2012-03-01 12:16:59 +01:00
Rainer Gerhards
1773bfa14b Merge branch 'v6-stable'
Conflicts:
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
	runtime/conf.c
	runtime/rsyslog.h
2012-01-27 13:52:27 +01:00
Rainer Gerhards
2c172dcf82 Merge branch 'v4-stable' into v5-stable 2012-01-27 12:50:19 +01:00
Rainer Gerhards
b826c0d3c5 Merge branch 'v5-devel' & fix bug in BSD imklog driver
Conflicts:
	plugins/imklog/ksym.c
	plugins/imklog/linux.c
2012-01-23 18:19:19 +01:00
Rainer Gerhards
01405d78f4 refactored imklog linux driver, now combined with BSD driver
The Linux driver no longer supports outdated kernel symbol resolution,
which was disabled by default for very long. Also overall cleanup,
resulting in much smaller code. Linux and BSD are now covered by a
single small driver.
2012-01-23 18:05:07 +01:00
Rainer Gerhards
0b5980df01 licensing change 2012-01-21 17:41:15 +01:00
Rainer Gerhards
6624ad434b Merge branch 'v6-stable-noscoping' into master
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	plugins/imfile/imfile.c
	plugins/imklog/imklog.c
	plugins/immark/immark.c
	plugins/imptcp/imptcp.c
	plugins/imrelp/imrelp.c
	plugins/imtcp/imtcp.c
	plugins/imtemplate/imtemplate.c
	plugins/imudp/imudp.c
	plugins/imuxsock/imuxsock.c
	plugins/mmsnmptrapd/mmsnmptrapd.c
	plugins/omtemplate/omtemplate.c
	runtime/glbl.c
	runtime/parser.c
	tools/omfile.c
	tools/syslogd.c
2012-01-19 13:07:46 +01:00
Rainer Gerhards
9b24152b6a undoing v6.1 config scoping interface, part I
The most common files are now changed, more needs to be done.
2012-01-18 18:21:08 +01:00
Rainer Gerhards
a7e3afb20b milestone: added module config names 2011-07-20 10:47:24 +02:00
Rainer Gerhards
8488d8c3c1 Merge branch 'v5-devel'
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	plugins/imfile/imfile.c
	plugins/imklog/imklog.c
	plugins/imptcp/imptcp.c
	plugins/imtcp/imtcp.c
	plugins/imuxsock/imuxsock.c
	plugins/mmsnmptrapd/mmsnmptrapd.c
	tools/omfile.c
2011-06-27 12:33:26 +02:00
Rainer Gerhards
47729f3b93 added support for obtaining timestamp for kernel message from message
If the kernel time-stamps messages, time is now take from that
timestamp instead of the system time when the message was read. This
provides much better accuracy. Thanks to Lennart Poettering for
suggesting this feature and his help during implementation.
2011-06-24 17:07:11 +02:00
Rainer Gerhards
a9223031a6 step: imklog (linux) moved to v2 config system 2011-05-25 14:04:14 +02:00
Rainer Gerhards
c0d1334f6e step: imtcp moved to new config interface
as far as we know that new interface right now ;)
2011-05-05 11:36:05 +02:00
Rainer Gerhards
d0d9f823b7 step: put plumbing in place for new input module config system 2011-05-03 18:02:18 +02:00
Rainer Gerhards
df5c3b8cdd Merge branch 'v5-devel'
Conflicts:
	tools/omfile.c
2011-04-26 18:45:12 +02:00