afmongodb: Do not consider successfully inserted messages as stored ones.

Stored messages are message which are stored in disk or memory buffer.
afmongodb: Do not try to add _id field.

MongoDB server does append an _id field automatically if none present.
If the incoming message already have an _id field, we pass it along
to the server.

References: v1 TK-44852
afmongodb: Factored out afmongodb_dd_init_value_pairs_dot_to_underscore_transformation
afmongodb: Factored out message dropping function.

Signed-off-by: Viktor Tusa <tusavik@gmail.com>
afmongodb: Added message retry feature if insert to db failed.

MongoDB dest driver tries to insert into the database three times
before dropping the message.

Signed-off-by: Viktor Tusa <tusavik@gmail.com>
value-pairs: Create an evt_tag_value_pairs function.

evt_tag_value_pairs works exactly like a value_pairs_foreach,
which generates a string to an EVTTAG. It can be safely used from
msg_* macros without having to know if we are in debug mode or not.
afmongodb: Use evt_tag_value_pairs to print the message inserted into mongodb.

Because it is nicer, and can be used in msg_error, too.
Also log the message we try to insert into mongodb.

Signed-off-by: Viktor Tusa <tusavik@gmail.com>
afmongodb: We should not try to insert message into db if the connection failed.

If the connections fails, we shouldn't consume a message. If flow-control is
on, the queue will be held back, if it is off, the message will be dropped
if the queue is full.
afmongodb: Forget need drop and drop the message if value_pairs_walk fails.

If value_pairs_walk fails, that means that a typecast has been failed.
So the only sane thing we can do is to log this problematic message
and drop it. We return with TRUE here because the destination should not go
to sleep.
afmongodb: Number of failed inserts can now set through config.

Via the retries() option.

Signed-off-by: Viktor Tusa <tusavik@gmail.com>
afmongodb: Show a warning when throttle is set.

Throttle is not working and not supported in MongoDB destination,
so we will show a warning and set throttle back to zero.
afmongodb: Setting safe_mode default to true.
afmongodb: Added one minute socket timeout for MongoDB connection.

Signed-off-by: Viktor Tusa <tusa@balabit.hu>
afmongodb: Eliminate magic numbers if MongoDB drivers.

Signed-off-by: Viktor Tusa <tusa@balabit.hu>
afmongodb: use the recovery_cache API from the refactored libmongo-client

Signed-off-by: Budai Laszlo <lbudai@balabit.hu>
Signed-off-by: Viktor Tusa <tusavik@gmail.com>
afmongodb: process *all* items of the server list (including 1st one)

Signed-off-by: Budai Laszlo <lbudai@balabit.hu>
afmongodb: add reason of insertion failure to error message

Signed-off-by: Budai Laszlo <lbudai@balabit.hu>
mongodb: support connecting to mongodb via unix domain socket

Signed-off-by: Budai Laszlo <lbudai@balabit.hu>
libmongo-client: Updated internal submodule to contain recovery_cache feature.