Conrad Hoffmann | 12 Aug 2012 04:06
Favicon
Gravatar

[PATCH] [0/1] Allow mongodb destination to use Unix sockets

As promised this is actually the second part of the previous patch, but
since the other one was for a different repo I decided to keep them seperate.
Yet, this one depends on the former.

This patch is also for syslog-ng-3.4, master branch.

Like I mentioned, I already used Unix sockets successfully, though I must add
that this was with a modified version of the path for syslog-ng-3.3, because
I had trouble getting 3.4 to work at all.

I will take another look at this tomorrow, but maybe you can give some 
feedback already?

Conrad Hoffmann (1):
  Allow Unix sockets for MongoDB connection.

 modules/afmongodb/afmongodb-grammar.ym |  2 ++
 modules/afmongodb/afmongodb-parser.c   |  1 +
 modules/afmongodb/afmongodb.c          | 25 +++++++++++++++++++++----
 modules/afmongodb/afmongodb.h          |  1 +
 4 files changed, 25 insertions(+), 4 deletions(-)

--

-- 
1.7.11.4

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq

(Continue reading)

Conrad Hoffmann | 12 Aug 2012 04:06
Favicon
Gravatar

[PATCH] [1/1] Allow Unix sockets for MongoDB connection.

Signed-off-by: Conrad Hoffmann <ch <at> bitfehler.net>
---
 modules/afmongodb/afmongodb-grammar.ym |  2 ++
 modules/afmongodb/afmongodb-parser.c   |  1 +
 modules/afmongodb/afmongodb.c          | 25 +++++++++++++++++++++----
 modules/afmongodb/afmongodb.h          |  1 +
 4 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/modules/afmongodb/afmongodb-grammar.ym b/modules/afmongodb/afmongodb-grammar.ym
index 71dd46d..c5d97c4 100644
--- a/modules/afmongodb/afmongodb-grammar.ym
+++ b/modules/afmongodb/afmongodb-grammar.ym
 <at>  <at>  -50,6 +50,7  <at>  <at>  extern ValuePairsTransformSet *last_vp_transset;

 %token KW_MONGODB
 %token KW_COLLECTION
+%token KW_PATH
 %token KW_SERVERS
 %token KW_SAFE_MODE

 <at>  <at>  -77,6 +78,7  <at>  <at>  afmongodb_option
 	| KW_SAFE_MODE '(' yesno ')'		{ afmongodb_dd_set_safe_mode(last_driver, $3); }
         | KW_HOST '(' string ')'                { afmongodb_dd_set_host(last_driver, $3); free($3); }
         | KW_PORT '(' LL_NUMBER ')'             { afmongodb_dd_set_port(last_driver, $3); }
+        | KW_PATH '(' string ')'                { afmongodb_dd_set_path(last_driver, $3); free($3); }
 	| value_pair_option			{ afmongodb_dd_set_value_pairs(last_driver, $1); }
 	| dest_driver_option
         ;
diff --git a/modules/afmongodb/afmongodb-parser.c b/modules/afmongodb/afmongodb-parser.c
index 9d72878..8aa55c1 100644
(Continue reading)

Balazs Scheidler | 12 Aug 2012 17:04
Picon

Re: [PATCH] [1/1] Allow Unix sockets for MongoDB connection.

Hi,

This looks good to me, but again, I'd wait for Algernon's OK, especially
on the libmongo-client part.

On Sun, 2012-08-12 at 04:06 +0200, Conrad Hoffmann wrote:
> Signed-off-by: Conrad Hoffmann <ch <at> bitfehler.net>
> ---
>  modules/afmongodb/afmongodb-grammar.ym |  2 ++
>  modules/afmongodb/afmongodb-parser.c   |  1 +
>  modules/afmongodb/afmongodb.c          | 25 +++++++++++++++++++++----
>  modules/afmongodb/afmongodb.h          |  1 +
>  4 files changed, 25 insertions(+), 4 deletions(-)

--

-- 
Bazsi

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq

Gergely Nagy | 12 Aug 2012 21:23
Picon
Gravatar

Re: [PATCH] [0/1] Allow mongodb destination to use Unix sockets

Conrad Hoffmann <ch <at> bitfehler.net> writes:

> I will take another look at this tomorrow, but maybe you can give some 
> feedback already?

One thing that I'm missing - at least, on a first glance - is handling
the case where path() is specified in the config along with servers(),
host() or port(). Since one can do only one of these, having path() with
any of the others should produce an error, I believe.

--

-- 
|8]

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq

Conrad Hoffmann | 12 Aug 2012 22:09
Favicon
Gravatar

Re: [PATCH] [0/1] Allow mongodb destination to use Unix sockets

On 08/12/2012 09:23 PM, Gergely Nagy wrote:
> One thing that I'm missing - at least, on a first glance - is handling
> the case where path() is specified in the config along with servers(),
> host() or port(). Since one can do only one of these, having path() with
> any of the others should produce an error, I believe.

Yeah, I admit I didn't spent too much time on that issue :)
Last night I mainly wanted to get it to work and didn't really check if
there are any possibile "misconfigurations" - I will take another look
at this and try out some configs and then send you an updated patch.
Probably not before Wednesday, though.

Anyways, thanks for the feedback!

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq


Gmane