120 Commits

Author SHA1 Message Date
Janmejay Singh
15afe8245f created param in add-flow to indicate if a graph being added to global-variable is shared, so it can be deep-copied instead of referenced (external modifications to which can not be protected from unsafe concurrent access) + killed an unused function 2015-05-26 09:41:35 +05:30
Rainer Gerhards
2a314e8e61 make imfile emit filname metadata and begin metadata system
- add message metadata "system" to msg object
  this permits to store metadata alongside the message
- imfile: add support for "filename" metadata
  this is useful in cases where wildcards are used

see also https://github.com/rsyslog/rsyslog/issues/199
2015-01-09 12:14:28 +01:00
Janmejay Singh
4ca5e217e2 Adds support for 'reset' statement (it has syntax similar to set 'set', but _unlike_ 'set' always force-sets the given value insteed of conditionally merging it, or not saving it because it is trying to replace an object with a leaf value etc).
Syntax:

reset $.foo = $!bar;

etc.
2014-12-17 11:39:31 +01:00
Janmejay Singh
9c28cc9955 support for addressing json array members 2014-12-17 11:39:30 +01:00
Rainer Gerhards
a407348963 refactor PRI-handling code 2014-10-08 12:50:10 +02:00
Rainer Gerhards
196c6c8e74 undo interface changes to getTime* functions
I originally thought that I would need to do dynamic memory
alloc and extended the interface to support this. Fortunatley,
this could be avoided, and so I undo that change now.
2014-04-30 12:01:01 +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
f860025bd4 mmexternal: support "json" inbound message passing 2014-04-08 12:24:28 +02:00
Rainer Gerhards
3d4496c583 Merge branch 'v8-stable'
Conflicts:
	runtime/msg.h
2014-04-04 18:43:36 +02:00
Rainer Gerhards
5a92054bdf apply a couple of (useful) "const" attributes
The primary reason is to avoid unnecessary merge conflicts
when merging up to newer code, which more insist on the
"const correctness" - but we may get some optimizer benefits
as well.
2014-04-04 15:02:56 +02:00
Rainer Gerhards
90e2a1a8df add modifiable properties to external message modification module interface
The set is still incomplete, but I noticed that it is better to add some
"const" definitions to older versions (probably v7-stable) before
continuing.
2014-04-04 08:19:14 +02:00
Rainer Gerhards
a7c6b9cde5 milestone/mmexternal: support replacing msg property, fix stall in mmexternal 2014-03-17 08:00:21 +01:00
Rainer Gerhards
0dd121d65b milestone/mmexternal: permit update to rawmsg property
this is the first PoC
2014-03-16 17:42:00 +01:00
Rainer Gerhards
f458911955 introduce new API for modifying message object (just a skeleton) 2014-03-09 18:35:41 +01:00
Rainer Gerhards
5cddb0533b fix VAR handling in script grammar and code
The $-var designator is now correctly stripped off the varname.
2013-10-23 17:29:04 +02:00
Rainer Gerhards
059a316824 refactor: align jsonFind() calling interface with recent changes 2013-10-23 15:59:23 +02:00
Rainer Gerhards
b5a5041d75 minor cleanup 2013-10-23 15:53:49 +02:00
Rainer Gerhards
e93ebb79db refactor: remove now no-longer needed functions 2013-10-23 15:50:42 +02:00
Rainer Gerhards
c0f4474389 refactor get.*PropVal() series of functions 2013-10-23 15:12:30 +02:00
Rainer Gerhards
eb9adf9baa refactor: simplify JSON variable access 2013-10-23 13:08:56 +02:00
Rainer Gerhards
7d39740b3d refactor: use common code for message property description processing
in all cases except script var access -- this comes next...
2013-10-22 17:55:35 +02:00
Rainer Gerhards
7a15d40a42 refactor: somewhat simplify property-name-to-id mapping 2013-10-21 17:22:32 +02:00
Rainer Gerhards
f4f2a493b0 work a bit toward string handling unification 2013-10-21 17:12:07 +02:00
Rainer Gerhards
a8b1e96d7b Merge branch 'v7-stable-mmrfc5424addhmac'
Conflicts:
	Makefile.am
	configure.ac
	runtime/msg.c
	runtime/rsyslog.h
2013-09-26 12:41:50 +02:00
Rainer Gerhards
039e23df84 Merge branch 'v7-stable' 2013-09-26 12:37:36 +02:00
Rainer Gerhards
3b78f4c50c remove no-longer needed data item 2013-09-25 17:30:19 +02:00
Rainer Gerhards
b810f0dd3a mmrfc5424addhmac: complete initial implementation
hash is now also persisted back to structured-data rsyslog
property
2013-09-25 17:15:58 +02:00
Rainer Gerhards
c787fb9ce9 simplify STRUCTURED-DATA representation in msg object 2013-09-25 16:48:21 +02:00
Rainer Gerhards
593c8e41d1 milestone: mmpstrucdata parses STRUCTURED-DATA (but does not yet store it) 2013-09-23 16:10:12 +02:00
Rainer Gerhards
90e1478f11 expose so-far msg-internal method to query structured data
This also lead to a slight performance optimization in the msg.c
module (when it comes to querying structured data).

This is stage work in order to provide the capability to fully
parse structured data.
2013-09-23 12:47:21 +02:00
Rainer Gerhards
d5f3ab3117 mmrfc5424addhmac milestone: do not process non-rfc5424 messages 2013-09-23 12:15:15 +02:00
Rainer Gerhards
8d4a5152cb Merge branch 'v7-stable' 2013-09-03 11:54:20 +02:00
hwoarang
1c71b9628b make rsyslog use the new json-c pkgconfig file if available 2013-09-03 11:38:01 +02:00
Rainer Gerhards
743a2ddf9f Merge branch 'c9'
Conflicts:
	runtime/msg.c
2013-09-02 12:34:46 +02:00
Rainer Gerhards
d11e8221a8 milestone: defaultTZ can be set in msg obj (via imtcp)
... but parser does not yet use it.
2013-08-30 18:29:46 +02:00
Rainer Gerhards
4ecd6bb946 first shot at global variables (without proper sync so far) 2013-07-22 17:38:31 +02:00
Rainer Gerhards
4c2bef51d1 milestone: basic local variable functionality available
but some nits, like do not work with disk queues
2013-07-17 11:37:53 +02:00
Rainer Gerhards
d4ca9a48d6 refactor in preparation of local variables
local variables require a second json root; this refactoring makes
sure we can basically use common functions for json handling
2013-07-17 09:47:14 +02:00
Tomas Heinrich
b424b8c249 Don't #include libestr and libee headers when not necessary
Through msg.h, many unrelated components needlessly required
LIBEE_CFLAGS.
2013-05-20 21:32:49 +02:00
Rainer Gerhards
a6aa2b75ee mmanon: complete ipv4 functionality 2013-03-04 12:59:53 +01:00
Rainer Gerhards
47e11d68b2 optimize: obtaining programname
included some additional refactoring for cleaner code
2013-01-14 13:44:36 +01:00
Rainer Gerhards
262d059990 optimize msg.c/textpri
remove snprintf() in favor for quicker code
2013-01-14 11:49:27 +01:00
Rainer Gerhards
42d1d27a01 Merge branch 'v7-stable-newmsglock' into master-newmsglock
Conflicts:
	runtime/msg.c
	runtime/queue.c
	tools/syslogd.c
2012-12-06 17:27:37 +01:00
Rainer Gerhards
27e0f06b17 Merge branch 'v6-stable-newmsglock' into v7-stable-newmsglock
Conflicts:
	tools/syslogd.c
2012-12-06 17:03:51 +01:00
Rainer Gerhards
3495720a2f bugfix: some message properties could be garbled due to race condition
This happened only on very high volume systems, if the same message was
being processed by two different actions. This was a regression caused
by the new config processor, which did no longer properly enable msg
locking in multithreaded cases. The bugfix is actually a refactoring of
the msg locking code - we no longer do unlocked operations, as the use
case for it has mostly gone away. It is potentially possible only at
very low-end systems, and there the small additional overhead of doing
the locking does not really hurt. Instead, the removal of that
capability can actually slightly improve performance in common cases,
as the code path is smaller and requires slightly less memory writes.
That probably outperforms the extra locking overhead (which in the
low-end case always happens in user space, without need for kernel
support as we can always directly aquire the lock - there is no
contention at all).
2012-12-06 15:40:15 +01:00
Rainer Gerhards
479657a045 cleanup: remove no longer needed function 2012-11-06 18:18:16 +01:00
Rainer Gerhards
94f6326237 queue: reduce CPU load for deserializing message properties
Linear runtime due to message order. Was quadratic before. However, not
a big overall improvement.
2012-11-06 17:48:35 +01:00
Rainer Gerhards
5a64366922 queue: remove time() calls from msg deserialization 2012-11-03 17:07:22 +01:00
Rainer Gerhards
c28d92259b queue: use specific deserializer for msg object
spares lengthy table lookups
2012-11-03 13:27:27 +01:00
Rainer Gerhards
f88d4f76f6 queue: remove unnecessary (obj_t*) redirection from msg ptrs 2012-11-03 12:51:19 +01:00