syslog-ng source
afmongodb-private.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2016 Balabit
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 as published
6  * by the Free Software Foundation, or (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * As an additional exemption you are allowed to compile & link against the
18  * OpenSSL libraries as published by the OpenSSL project. See the file
19  * COPYING for details.
20  *
21  */
22 
23 #ifndef AFMONGODB_PRIVATE_H_
24 #define AFMONGODB_PRIVATE_H_
25 
26 #include "syslog-ng.h"
27 #if SYSLOG_NG_HAVE_MONGOC_V2
28 # include "mongoc/mongoc.h"
29 #else
30 # include "mongoc.h"
31 #endif
33 #include "template/templates.h"
35 
36 /* Compatibility macros for BSON array API
37  * Note: BSON_APPEND_ARRAY_BEGIN already exists and uses strlen(), but we pass -1 for auto-length.
38  */
39 #if SYSLOG_NG_HAVE_DECL_BSON_APPEND_ARRAY_UNSAFE_BEGIN
40 # define BSON_APPEND_ARRAY_BEGIN_AUTOLEN(b, k, c) bson_append_array_unsafe_begin(b, k, -1, c)
41 #else
42 # define BSON_APPEND_ARRAY_BEGIN_AUTOLEN(b, k, c) bson_append_array_begin(b, k, -1, c)
43 #endif
44 
45 typedef struct _MongoDBDestDriver
46 {
47  LogThreadedDestDriver super;
48 
49  GString *uri_str;
50  LogTemplate *collection_template;
52 
53  LogTemplateOptions template_options;
54 
55  gboolean use_bulk;
56  gboolean bulk_unordered;
59 
60  ValuePairs *vp;
61 
62  const gchar *const_db;
63  mongoc_uri_t *uri_obj;
64  mongoc_client_pool_t *pool;
66 
67 #endif
Definition: afmongodb-private.h:46
mongoc_client_pool_t * pool
Definition: afmongodb-private.h:64
LogThreadedDestDriver super
Definition: afmongodb-private.h:47
ValuePairs * vp
Definition: afmongodb-private.h:60
gboolean use_bulk
Definition: afmongodb-private.h:55
GString * uri_str
Definition: afmongodb-private.h:49
mongoc_uri_t * uri_obj
Definition: afmongodb-private.h:63
int32_t write_concern_level
Definition: afmongodb-private.h:58
LogTemplate * collection_template
Definition: afmongodb-private.h:50
gboolean bulk_bypass_validation
Definition: afmongodb-private.h:57
gboolean bulk_unordered
Definition: afmongodb-private.h:56
LogTemplateOptions template_options
Definition: afmongodb-private.h:53
const gchar * const_db
Definition: afmongodb-private.h:62
gboolean collection_is_literal_string
Definition: afmongodb-private.h:51