54 Commits

Author SHA1 Message Date
Rainer Gerhards
5e3b075d53 fix compiler warnings 2016-06-02 12:08:55 +02:00
Rainer Gerhards
e5b59f5734 ommongodb: small cleanup/improvement 2016-04-09 14:18:59 +02:00
Rainer Gerhards
bfc9313dea ommongodb: fix indention 2016-04-09 14:18:34 +02:00
Rainer Gerhards
aafccded37 ommongodb: do not use json lib implementation details
Some internal data elements are accessed, which is bad and no
longer possible with newer versions of libfastjson and is bad
style in any case (albeit "approved" by json-c).

closes https://github.com/rsyslog/rsyslog/issues/943
2016-04-09 14:14:33 +02:00
Rainer Gerhards
0d71c63608 stop using fjson_object_object_foreachC()
...and friends. This uses internals of the json library. It was
required when we used json-c, where distros often shipped versions
that did miss its clean counterpart. Now that we require
libfastjson, we can (and should) use the clean method.

closes https://github.com/rsyslog/rsyslog/issues/941
2016-04-07 18:07:04 +02:00
Rainer Gerhards
accfa81e5d cleanup: remove compatibility checks for old json-c
as we now use libfastjson, we do no longer need to check for "new"
features, as these are always present in libfastjson (things
like json_object_object_get_ex()).

closes https://github.com/rsyslog/rsyslog/issues/935
2016-04-05 12:16:09 +02:00
Rainer Gerhards
43e868a414 Merge branch 'travis-mongodb' into merge-706 2016-02-17 16:40:15 +01:00
Rainer Gerhards
4d4beb957f ommongodb: implement missing return value check 2016-02-17 15:39:57 +01:00
Rainer Gerhards
dbb8607529 ommongodb: fix alignment build warnings 2016-02-16 15:29:42 +01:00
Rainer Gerhards
64f1efdc15 Merge branch 'pull-mongo-extended-json' of https://github.com/Baqend/rsyslog into merge-706 2016-02-16 13:59:12 +01:00
Rainer Gerhards
07a074dd88 cleanup: remove dbgprintf's not intended to stay
those starting at column 0 are temporary debug aids during development.
Some of them I intend to keep in for a version or two. Some of them
I tend to forget later. This is a cleanup of those. Most are removed,
some are promoted to be permanently there - now indicated by proper
indention.
2016-01-13 09:20:07 -05:30
fb
9695bdbc23 implemented extended json format for dates in ommongodb 2015-12-16 18:48:06 +01:00
Joshua Sorenson
955cafa5ab Whitespace cleanup 2015-03-02 11:44:45 -05:00
Joshua Sorenson
a553d916df Update "MySQL" to "MongoDB" in ommongodb.c 2015-03-02 11:44:34 -05:00
Rainer Gerhards
b3a7156c04 Merge branch 'v7-stable'
Conflicts:
	ChangeLog
2014-02-15 16:01:51 +01:00
eczema
18eaa5cc5c Update ommongodb.c
Template is not mandatory regarding latest documentation
2014-02-15 15:56:59 +01:00
Rainer Gerhards
9893a982a2 ommongodb: fix compile problem
regression from pull request #17 from jtv4k/master
2014-01-27 10:15:32 +01:00
Rainer Gerhards
ffec9f0313 ommongodb: change comments to C-style
C++ style comments cause compile failures on some platforms
2014-01-26 17:51:09 +01:00
JT
f3397e5c2f Added authentication using existing uid and pwd attributes. 2014-01-24 12:10:54 -08:00
Rainer Gerhards
d077eff698 ommongodb: minimal support for v8 omod interface
single instance, untested
2013-11-13 13:06:37 +01:00
Rainer Gerhards
0088c275da Merge branch 'master' into master-var-refactor 2013-10-26 15:46:18 +02:00
Pavel Levshin
200b434316 Make use of int64 json numbers, if available 2013-10-26 15:40:50 +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
f4f2a493b0 work a bit toward string handling unification 2013-10-21 17:12:07 +02:00
Rainer Gerhards
dd9bdb5566 bugfix: some more build problems with newer json-c versions
Thanks to Michael Biebl for mentioning the problem.
2013-09-04 10:07:16 +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
e5ef73eb25 bugfix: invalid rsyslog-internal macro API use
This had no bad effect, because the macro did the same as the one
that should have been used.
2012-11-01 17:05:07 +01:00
Rainer Gerhards
205114176d Merge branch 'v7-stable' 2012-10-24 14:45:01 +02:00
Rainer Gerhards
d579eacd44 ommongodb rate-limits error messages to prevent spamming the syslog
closes (for v7.2): http://bugzilla.adiscon.com/show_bug.cgi?id=366
2012-10-24 12:38:34 +02:00
Rainer Gerhards
9b4a225c59 refactor tpl processor so that date is queried once per template
Things like $YEAR, $MONTH required a time() call each.
2012-10-10 19:20:19 +02:00
Miloslav Trmač
e273e0ef19 Handle JSON value "null" instead of crashing
Future json-c versions will handle this transparently, for now we have
to do it manually.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2012-09-24 14:57:54 +02:00
Rainer Gerhards
037eaa0d69 new ruleengine: implement template type "subtree" 2012-09-18 11:32:45 +02:00
Rainer Gerhards
081f366c57 adapted Mirek's changes to new JSON passing mode
now the complete code (JSON passing & ommongodb) could be tested
and passed the module tests made during development
2012-08-29 14:05:06 +02:00
Miloslav Trmač
9bd45fcb72 Add template support: parse text, convert to BSON
Uses a json-c library (http://oss.metaparadigm.com/json-c/).

With this, a template
> $template MongoTemplate,"{%hostname:::jsonf:sys%, %$!all-json:2:$:%"
and action
> &    action(type="ommongodb" db="ceelog" collection="local" template="MongoTemplate")

will store a record created by
> logger -d -u p/dev/log -p mail.info -t mymailer '@cee: {"false": false, "null": null, "true": true, "object": {"a":"a", "b":"b"}, "array": [1, 2, 3], "number1": 3, "number2": 3.14, "string": "String"}'

as
> { "_id" : ObjectId("5037bbfc97dd811374ce5a00"), "sys" : "kulicka", "false" : "false", "null" : "-", "true" : "true", "object.a" : "a", "object.b" : "b", "array.*" : "3", "number1" : "3", "number2" : "3.140000", "string" : "String" }

which is not great, but fair enough given the current design of
libee (the information loss manifests by the time of template processing,
ommongodb can't fix it).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2012-08-29 12:39:30 +02:00
Miloslav Trmač
1e09e2729e Split MongoDB output into BSON creation and MongoDB interaction
This will allow us to add template processing more cleanly.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2012-08-29 12:36:51 +02:00
Miloslav Trmač
14875be702 Remove a no-effect ", NULL";
It does nothing, at is just confusing.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2012-08-26 10:14:50 +02:00
Miloslav Trmač
7d58175dbe Silence compiler warnings about unused parameters.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2012-08-26 10:14:28 +02:00
Rainer Gerhards
9896cf16b7 ommongodb: extended default schema
includes more syslog-specific fields
2012-03-30 17:57:15 +02:00
Rainer Gerhards
2fbac28d3c ommongodb: now writes a real timestamp into mongo 2012-03-30 09:55:45 +02:00
Rainer Gerhards
8aa7784e3d ommongodb: working on error reporting 2012-03-20 12:56:27 +01:00
Rainer Gerhards
e0d69d3e10 ommongodb: basic error reporting 2012-03-20 12:11:38 +01:00
Rainer Gerhards
bc29adfa8d ommongodb: support for lumberjack base schema
... as far as I currently see the mapping ;)
2012-03-19 09:55:19 +01:00
Rainer Gerhards
dd77089b5c ommongodb: moved over to MSG based interface
Access to the message permits us to do "the right thing" when it comes
to populating the lumberjack schema. Support for custom templates will
be added as soon as the template system is ready to properly support
name/value passing.
2012-03-19 08:24:34 +01:00
Rainer Gerhards
53a5f00046 ommongodb: cleanup 2012-03-18 13:17:07 +01:00
Brian Knox
3e008a14ba ommongodb: moved field set a bit towards CEE 2012-03-18 13:09:52 +01:00
Rainer Gerhards
488a4a69e3 ommongodb: honor db and collection config parameters 2012-03-17 19:02:21 +01:00
Rainer Gerhards
f6434d87c4 ommongodb: support for v6 config system added 2012-03-16 18:12:59 +01:00
Rainer Gerhards
7d509d53df ommongodb: milestone:refactored to use libmongo-client
which is waaaaaaay better than the 10gen client driver
2012-03-12 16:49:09 +01:00
Rainer Gerhards
9a3ff6a2b1 ommongodb: made ommongodb compile on current rsyslog version 2012-03-07 16:51:19 +01:00
Rainer Gerhards
46136b1d6b ommongodb: adding ASL 2.0 license header
after clarifying and receiving permission to do so with original
contributor Victor Pereira (email exchange on 2011-02-22)
2012-03-07 14:34:03 +01:00