80 Commits

Author SHA1 Message Date
Rainer Gerhards
e0d62c6443
fix some nits found by analyzers 2018-12-30 17:19:14 +01:00
Rainer Gerhards
7a7cdc434d
fix trailing whitespace in Python files 2018-09-23 08:51:30 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Rainer Gerhards
fff09ac94d
core: replace errmsg object calling conventions
old interface still needs to be removed to fully finish
refactoring of this component.

see also https://github.com/rsyslog/rsyslog/issues/1684
2018-07-21 17:47:29 +02:00
Rainer Gerhards
4020e9e7a4
impstats: emit warning if log.syslog="off" and ruleset name given
With this config, "ruleset" is silently ignored, what probably is
not obvious to a user.

closes https://github.com/rsyslog/rsyslog/issues/2821
2018-07-06 18:29:51 +02:00
c8da318ded impstats: Updated python based statslog analyzer sample scripts.
Changed files from ANSi to UTF8
2018-07-03 09:05:30 +02:00
Rainer Gerhards
5ce74d0610 impstats bugfix: segfault if bound to non-existing ruleset
segfault happens during shutdown; up until unload of impstats,
rsyslog works correctly, except that no pstats are emitted. This
can be considered to be expected, because the error message
indicates the default ruleset is used instead. This is what
now actually happens.

closes https://github.com/rsyslog/rsyslog/issues/2645
2018-04-16 09:43:55 +02:00
Rainer Gerhards
4cba3c8b20 fix invalid HTML header in JavaScript
detected by lgtm.com static analyzer
2018-03-16 19:03:03 +01:00
Rainer Gerhards
48c248d626 impstats: fix invalid counter definitions for getrusage() reporting
some of the counters were defined as  int (32 bit) vs. intctr_t (64 bit).
On some platforms "long" seems to be 64bit, and getrusage() provides
what we store as int via long. So this caused truncation and/or overflow.
This had undefined effects. Most often, everything worked fine
for values smaller than 2^31 but sometimes we got negative values.

closes https://github.com/rsyslog/rsyslog/issues/1517
2017-12-31 17:12:51 +01:00
BSD Patch
27eb259846 impstats: import BSD project patch 2017-12-18 13:17:40 +01:00
Rainer Gerhards
025ed2a933 impstats bugfix: impstats does not handle HUP
If the parameter "log.file" is specified, impstats writes its own
log file. However, HUP is not handled for this file, which makes
the functionality unusable with log rotation. It is also counter-
intuitive for users.

This patch enables correct HUP processing. As a sideline, it also
introduces a generic HUP processing framework for non-action type
of loadable modules.

closes https://github.com/rsyslog/rsyslog/issues/1662
closes https://github.com/rsyslog/rsyslog/issues/1663
2017-07-20 14:22:19 +02:00
Rainer Gerhards
8de60bf9c1 impstats: add new ressoure counter "openfiles"
closes https://github.com/rsyslog/rsyslog/issues/1661
2017-07-13 18:15:43 +02: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
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
170bf66556 refactor stats system: do use cstr only if needed
There are probably more areas that could be changed, but this is
a good self-sufficient change.

see also https://github.com/rsyslog/rsyslog/issues/1044
2016-05-19 11:28:00 +02:00
Rainer Gerhards
3549041b0f Merge branch 'dyn_stats' of https://github.com/janmejay/rsyslog into master-integrate-dynstats
Conflicts:
	.travis.yml
	grammar/rainerscript.c
	plugins/imdiag/imdiag.c
2016-01-28 09:51:25 +01:00
Rainer Gerhards
0f5595c074 impstats: support broken ElasticSearch JSON implementation
ES 2.0 no longer supports valid JSON and disallows dots inside names.
This adds a new "json-elasticsearch" format option which replaces
those dots by the bang ("!") character. So "discarded.full" becomes
"discarded!full".

This is a workaroud. A method that will provide more control over
replacemetns will be implemented some time in the future. For
details, see below-quoted issue tracker.

closes https://github.com/rsyslog/rsyslog/issues/713
2015-12-23 09:16:03 +01:00
Janmejay Singh
6da7aeb975 - dynstats basic-test first-cut
- vg-test caught a minor issue in impstats (fixed)
- placeholder created for other dynstats tests
- a new assertion in diag.sh which allows extracting a particular column and expecting sum-up to match given value
- imdiag supports injecting litteral messages now (test can send a fully formed syslog message through imdiag, its a backward compatible change in protocol, allows for richer things to be build while being fully backward compatible)
2015-11-13 17:45:07 +05:30
Brad Davis
a35779cc56 Fix missing headers that clang complains about 2014-12-11 13:03:22 +01:00
Rainer Gerhards
423c3ac62c pstats: add "origin" paramter to stats records
see also: https://github.com/rsyslog/rsyslog/issues/119
2014-11-19 15:49:09 +01:00
Rainer Gerhards
392d7f304a Merge branch 'v7-stable-bracketing' 2014-08-29 12:44:58 +02:00
Rainer Gerhards
8eccb3cbe0 impstats: add "bracketing" option 2014-08-29 12:44:06 +02:00
Rainer Gerhards
770fad169b Merge branch 'v7-devel' 2013-12-11 13:49:18 +01:00
Rainer Gerhards
923a90e8e9 impstats: output stats record on impstats (rsyslog) termination 2013-12-11 13:18:01 +01:00
Rainer Gerhards
2a1ad9d631 impstats: cleanup 2013-10-29 16:49:46 +01:00
Rainer Gerhards
8fd192bfa6 impstats: initial shot at multi-ruleset support 2013-10-19 11:48:04 +02:00
Rainer Gerhards
099968a1df remove compiler warning 2013-10-18 07:18:46 +02:00
Rainer Gerhards
490b083326 impstats: implement parameter "resetCounters"
it provides the capability to make impstats emit deltas in contrast to
accumulated counter values (see doc for details).
2013-09-09 15:41:07 +02:00
Rainer Gerhards
fbc737d650 experimental: make impstats return delta values where possible 2013-09-07 15:58:09 +02:00
5721c4dff6 update to newest version of stats scripts 2013-07-22 15:54:26 +02:00
e0da083bdd Started implementing statslog analyzer for impstats
This script will help finding unusual things in the impstats logs
2013-07-22 15:46:09 +02:00
a593ccddd4 Removed commandline arg count limit from scripts 2013-07-12 11:56:43 +02:00
fba8609b2a Added new option "chartscalcdelta" to generate charts with delta values instead of cumulative values.
Also fixed reading outputfile parameter in statslog-graph.py script.
2013-07-11 11:28:39 +02:00
53bd9a94ec Merge branch 'master' into v7-stats-scripts 2013-07-11 10:56:16 +02:00
Rainer Gerhards
02f28cd963 Merge branch 'c8'
Conflicts:
	ChangeLog
	plugins/impstats/impstats.c
2013-07-11 08:30:46 +02:00
Rainer Gerhards
330120d1ef impstats: add process resource usage counters [via getrusage()] 2013-07-11 08:28:07 +02:00
57fa85ee7f Added command line switch to generate bar charts in statslog-splitter.py 2013-07-05 15:48:17 +02:00
2953e6dc81 Fixed Datetime detection 2013-07-03 18:18:59 +02:00
ebe5266336 Added support for multiple regex commands, useful for parsing multiple rsyslog formats 2013-07-03 18:07:04 +02:00
036096c1b4 Added more command line options to customize the charts and their output 2013-07-03 16:50:18 +02:00
7b16f5c497 Finished statslog graph and splitter script.
Also added needed javascript files, so they can be included into the svg files.
This removes dependencies on external sources.

The statslog-splitter can now automatically generated SVG or PNG charts together
with an index.html in the output directory. This helps taking a quick view on all
generated stats data.
2013-07-03 13:21:46 +02:00
1d22bd58d4 Finsihed implementing chart gemerator script for impstats.
CSV Data generated by statslog-splitter is needed.
To run the chart script, the following packages need to be installed:
	- python pip
	- python cairosvg
With pip install these packages:
	- pip install CairoSVG tinycss cssselect pygal
2013-07-03 12:16:40 +02:00
fe88c0cd17 Started implementing stats chart generator 2013-07-02 17:05:39 +02:00
bc194a9b76 Added script to split impstats logfiles into processable csv files
Python 2.6 or higher is needed to run the script
2013-07-02 15:09:30 +02:00
Rainer Gerhards
5141493d32 impstats: solve build problem on FreeBSD
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=458
2013-06-24 11:37:28 +02:00
Rainer Gerhards
f373968c66 Merge branch 'v7-stable-libnet-frag'
Conflicts:
	ChangeLog
	configure.ac
	tools/omfile.c
2013-01-11 09:39:27 +01:00
Rainer Gerhards
77737e8ab2 impstats: added ability to write stats records to local file
...and avoid going through the syslog log stream. syslog logging can now
also be turned off (see doc for details).
2013-01-10 16:37:59 +01:00
Rainer Gerhards
66dcd68d62 Merge branch 'v7-stable-libnet-frag'
Conflicts:
	configure.ac
	plugins/impstats/impstats.c
	plugins/omudpspoof/omudpspoof.c
	runtime/rsyslog.h
2012-12-18 12:01:52 +01:00