61 Commits

Author SHA1 Message Date
BurramsettyAkshayaPranathi
a3b06324ac Fix typos: corrected 'intial' to 'initial' and 'intialize' to 'initialize' 2025-10-30 12:17:03 +05:30
Rainer Gerhards
b326c76f45 style: normalize C source formatting via clang-format (PoC)
This commit applies the new canonical formatting style using `clang-format` with custom settings (notably 4-space indentation), as part of our shift toward automated formatting normalization.

⚠️ No functional changes are included — only whitespace and layout modifications as produced by `clang-format`.

This change is part of the formatting modernization strategy discussed in:
https://github.com/rsyslog/rsyslog/issues/5747

Key context:
- Formatting is now treated as a disposable view, normalized via tooling.
- The `.clang-format` file defines the canonical style.
- A fixup script (`devtools/format-code.sh`) handles remaining edge cases.
- Formatting commits are added to `.git-blame-ignore-revs` to reduce noise.
- Developers remain free to format code however they prefer locally.
2025-07-16 13:56:21 +02:00
Michael Biebl
6569133c75
Typo fixes (#4801)
* typo fix: ambigious -> ambiguous

* typo fix: aquire -> acquire

* typo fix: assgined -> assigned

* typo fix: cancelation -> cancellation

* typo fix: childs -> children

* typo fix: configuraton -> configuration

* typo fix: delemiter -> delimiter

* typo fix: forwardig -> forwarding

* typo fix: initializiation -> initialization

* typo fix: intializing -> initializing

* typo fix: lengh -> length

* typo fix: mesage -> message

* typo fix: occured -> occurred

* typo fix: occurence -> occurrence

* typo fix: paramter -> parameter

* typo fix: remaing -> remaining

* typo fix: resetted -> reset

* typo fix: suppored -> supported

* typo fix: Sytem -> System

* typo fix: uncommited -> uncommitted

* typo fix: depricated -> deprecated

* typo fix: stoping -> stopping

* type fix: allow to -> allow one to
2022-02-17 10:54:12 +01:00
alakatos
321fc76f0f Move rsyslog global parameters to rsconf_t struct 2022-01-13 12:43:21 +01:00
Nelson Yen
91a2049877
percentile module to track percentile metrics via impstats
Brief overview:
TO configure tracking percentile metrics in rainerscript:
User would need to define:
  - which percentile to track, such as [p50, p99, etc.]
  - window size - note, this correlates directly with memory usage to
  track the percentiles.

To track a value, user would call built-in function `percentile_observe()` in their configurations to
record an integer value, and percentile metrics would be emitted every
impstats interval.
2021-06-23 00:14:39 -07:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Rainer Gerhards
9ffb75fb18
core: do not abort startup on problems setting scheduling policy
rsyslog creates a default scheduling policy on startup. This code
invalidly used CHKiRet (our exception handler) to check pthreads
return codes, what this macro cannot do. This lead to hard to
diagnose startup problems in cases where there were problems
setting the scheduling defaults (e.g. when rsyslog is set to run
at idle priority). Even more so, this blocked startup altogether,
which is not the right thing to do. Actually, this can be considered
a regression from commit 7742b21. That commit was 8 years ago, so
in general this cannot be a big issues ;-)

The code now emits proper error messages (to stderr, as at this point
no other output is available as it is during the initial state of
rsyslog initialization) and continues the startup.

closes https://github.com/rsyslog/rsyslog/issues/2855
2018-07-20 10:21:12 +02:00
Rainer Gerhards
2656afd4f5
build system: do not disable testbench tests via --disable-liblogging-stdlog 2018-07-02 11:13:05 +02:00
PascalWithopf
79de51e4fc codestyle: reduce max line length to 125 2017-12-20 16:16:57 +01:00
Rainer Gerhards
14c939af1f queue: provide informational messges on thread startup and shutdown
This provides better insight into operational state of rsyslog and is useful
in monitoring system health.
2017-08-01 17:43:32 +02:00
Rainer Gerhards
9e7d57a925 bugfix: rsyslog identifies itself as "liblogging-stdlog" in internal messages
This occured when liblogging-stdlog was used, and was used by default (without
explicit configuration). This is a regression of the new default, which does
not correctly call stdlog_open() in the default case.

closes https://github.com/rsyslog/rsyslog/issues/1442
2017-03-04 10:46:24 +01:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Janmejay Singh
671989350e fixed a few memory leaks and covered omprog cleanup with valgrind (one of the leaks affects any non-tx string-passing action) 2016-11-03 23:48:43 +05:30
Rainer Gerhards
070d987a45 fix compiler warnings 2016-06-01 09:49:46 +02:00
Rainer Gerhards
8e4bfe19b5 core: set default stack size to 4MiB
Note that this is below the usual 10MiB default, but should cause
no issues (output threads already use 4MiB stack size, for example).
This also addresses issues introduced by micro-libc's which only
provide very limited stack space by default.

closes https://github.com/rsyslog/rsyslog/issues/996
2016-04-29 10:10:29 +02:00
Rainer Gerhards
bc804df7fa clean up some more missing class exits (cosmetic) 2016-04-25 17:40:25 +02:00
Rainer Gerhards
7615ce350b fix cosmetic bug: strgen class was not de-initialized on rsyslog shutdown 2016-04-25 17:27:46 +02:00
Rainer Gerhards
fe4fb59647 wti object: fix cosmetic memory leak
This "leak" happes only immediately before shutdown, so it is not
a real leak. But it can get in our way when working with memory
debuggers.
2016-04-23 18:09:36 +02:00
Rainer Gerhards
375b7eced7 statsobj: fix cosmetic memory leak
This "leak" happes only immediately before shutdown, so it is not
a real leak. But it can get in our way when working with memory
debuggers.
2016-04-23 18:09:17 +02:00
Janmejay Singh
59b46975bd dyn-stats (dynamic metric-name support) high-level impl sketch 2015-11-09 22:31:01 +05:30
Janmejay Singh
4db25fb98b rainerscript: function random(max) which returns a random value in [0, max) 2015-06-23 15:38:59 +05:30
Tomas Heinrich
fddd1d98f4 Make liblogging-stdlog optional
Conflicts:
	configure.ac
	tools/rsyslogd.c
2014-12-03 15:33:26 +01:00
Rainer Gerhards
3065e0fbcd add support for specifying the liblogging-stdlog channel spec
new global parameter "stdlog.channelspec"
2014-04-01 12:41:51 +02:00
Rainer Gerhards
a42da69a72 nit: update copyright dates 2013-11-29 09:49:42 +01:00
Rainer Gerhards
89060ecec2 introduce new function to emit warning and other non-error messages
also refactor the error message subsystem a bit
2013-11-29 09:44:58 +01:00
Rainer Gerhards
1ea869ec54 use const keyword at (some) appropriate places 2013-11-29 09:16:03 +01:00
Rainer Gerhards
1e69188573 milestone: lookup table ready for actual load (but load not yet done) 2013-07-09 11:44:40 +02:00
Rainer Gerhards
9cf45a63f5 milestone: add lookup_table stmt to RainerScript
... but still does nothing execpt calling the handler.
2013-07-09 09:30:58 +02:00
Rainer Gerhards
819963d892 new ruleengine: cleanup 2012-09-07 12:54:22 +02:00
Rainer Gerhards
200e08ac42 new ruleengine: some cleanup 2012-09-06 11:09:16 +02:00
Rainer Gerhards
31900e004b more cleanup... 2011-07-11 15:36:05 +02:00
Rainer Gerhards
c809f8d1d9 more cleanup 2011-07-11 15:28:16 +02:00
Rainer Gerhards
84f217e87d cleanup, removing now unused code 2011-07-11 15:07:56 +02:00
Rainer Gerhards
d9ea755214 milestone/[PARTWORK]: implemented comparison operations 2011-07-08 09:13:39 +02:00
Rainer Gerhards
f72bde2f70 milestone: templates are now in config object 2011-04-19 09:43:36 +02:00
Rainer Gerhards
bbe1f2688c renaming conf.* wasn't a good idea -- undoing
too many dependencies, things get cluttered (and merging probably
gets problematic). Now new config will be "conf2".
2011-04-19 08:24:25 +02:00
Rainer Gerhards
e1c34e1741 renamed conf.c to legacyconf.c to make room for new config system 2011-04-19 07:53:23 +02:00
Rainer Gerhards
f7c2092004 Merge branch 'v5.6.2-newimudp' into v5-devel-newimudp
Conflicts:
	plugins/imudp/imudp.c
	threads.c
2011-01-10 12:54:21 +01:00
Dražen Kačar
7742b2182f improved imudp real-time scheduling support & bugfix
The original code had quite some issues, which are fixed by this
commit. Also we do more error checking now.

Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2011-01-10 12:39:23 +01:00
Rainer Gerhards
e86cb62f12 improved statistics-gathering subsystem
... well, actually this is a first real implementation of this subsystem.
I have added a counter registry, a way to access the countres (as readable
string) and a way to define and maintem them. Also, module impstats has
been updated to utilize the new system. Finally, I added some counters. I
hope that this sets the baseline for useful future enhancements.
2010-09-13 15:43:56 +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
4a5a3196fb Merge branch 'v4-devel' into master
Conflicts:
	runtime/Makefile.am
	runtime/atomic.h
	runtime/queue.c
	runtime/queue.h
	runtime/wti.c
	runtime/wti.h
	runtime/wtp.c
	runtime/wtp.h
2010-04-27 17:49:06 +02:00
Rainer Gerhards
cbe2e3d444 bugfix: problems with atomic operations emulation
replaced atomic operation emulation with new code. The previous code
seemed to have some issue and also limited concurrency severely. The
whole atomic operation emulation has been rewritten.
2010-04-27 17:31:28 +02:00
Rainer Gerhards
072fc663a8 added replacements for atomic instructions on systems that do not support them.
[backport of Stefen Sledz' patch for v5]
2010-03-23 15:04:24 +01:00
Steffen Sledz
a61e164a97 emulate missing atomic builtins with posix semaphores if available
Signed-off-by: Steffen Sledz <sledz@dresearch.de>
Acked-by: Thilo Fromm <t.fromm@dresearch.de>
2010-03-23 11:11:30 +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
6f511cecfa more cleanup and working towards a parser module calling interface
I cleaned up a lot of config variable access along the way. This
version compiles and runs, but does not yet offer any enhanced
functionality. pmrfc5424 is just a dummy that is not yet being used.
2009-11-03 12:39:48 +01:00
Rainer Gerhards
aaffc4281e introduced a new way of handling the RcvFrom property
... plus a fix for a long-time bug in obj-types.h. That lead to
the object pointer only then to become NULL when the object was
actually destructed, I discovered this issue during
introduction of the pRcvFrom property in msg_t, but it potentially had other
effects, too. I am not sure if some experienced instability resulted from this
bug OR if its fix will cause harm to so-far "correctly" running code. The later
may very well be. Thus I will change it only for the current branch and also
the beta, but not in all old builds. Let's see how things evolve.
2009-06-30 18:45:41 +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