64 Commits

Author SHA1 Message Date
Daniel Pocock
5c066da81e plugins/ommongodb/clean-mongo-syslog: support for MongoClient API 2017-01-15 08:38:47 +01:00
Benoit DOLEZ
f5a02a3cd0 ommongodb: close mongodb on error
To make tryResume working, the connection to mongodb need
to be closed. Then close it on "insert error".

Edit JTH:
- fixed spaces vs tabs indentation
2016-12-07 09:19:17 +01:00
Benoit DOLEZ
cecba99372 ommongodb: migration to v8, pointer dereference missing
Commit dbb8607529f188cf754115eedf5f33f3a687584f introduice a bug. Replacing
(uchar **)str[0] by (struct*)ptr remove a dereference.
Use *(struct **) instead of (struct *).
2016-12-07 09:19:17 +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
cfacd4c30f code cleanup: fix compiler warnings that newly came up
we got a bunch of new ones under updated Fedora
2016-10-11 14:10:25 +02:00
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
Daniel Pocock
3b83da0035 ommongodb: README: add comments about indexing 2014-11-28 09:48:41 +01:00
Daniel Pocock
b9c0183b32 ommongodb: add sample PyMongo-based script to purge old records 2014-07-29 14:58:32 +02: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
a5e51ced93 milestone: ommongodb supports templates & JSON passing API in place 2012-08-29 14:10:18 +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
Miloslav Trmač
f8ab9d1666 Remove obsolete ommongodb build instructions
The plugin now uses libmongo-client (which is configured using
pkg-config) instead of the 10gen client, so the instructions to copy
client source code no longer apply.
2012-06-05 19:00:55 +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