From: "Stefan G. Weichinger" <lists@xunil.at>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] aggregate logs into Elasticsearch
Date: Thu, 9 Apr 2020 10:42:21 +0200 [thread overview]
Message-ID: <e8c414d2-8846-8e2d-0b2f-0749cdbe30a5@xunil.at> (raw)
In-Reply-To: <87tv1zfiwl.fsf@wedjat.horus-it.com>
Am 04.04.20 um 16:02 schrieb Ralph Seichter:
> * Stefan G. Weichinger:
>
>> Maybe I look into mongodb as well, for example I found this small
>> howto: https://www.fluentd.org/guides/recipes/maillog-mongodb
>
> That looks unnecessarily complicated to me. While you can of course move
> data from an existing log file into MongoDB, I find configuring syslog
> to use a MongoDB destination (in addition to your files or as a full
> replacement) much easier.
>
> See [1] section "Storing messages in a MongoDB database". I have also
> done it with rsyslog, but that took a bit more work.
>
> Here's a syslog-ng destination I use. Note that using uri() allows
> passing parameters to modern MongoDB drivers which the older servers()
> statement cannot cope with.
>
> destination d_mongo {
> mongodb(
> uri("mongodb://user:pw@hostname:27017/syslog?authSource=admin&ssl=true")
> collection("messages")
> value-pairs(
> scope("selected-macros" "nv-pairs")
> pair("DATE", datetime("$UNIXTIME"))
> pair("PID", int64("$PID"))
> pair("SEQNUM", int64("$SEQNUM"))
> exclude("HOST*")
> exclude("LEGACY*")
> exclude("SOURCE*")
> exclude("TAGS")
> )
> );
> };
>
> Values are strings to begin with. This example excludes some values I am
> not interested in, and performs type conversion on others, for example
> mapping DATE to MongoDB's date/time data type (see ISODate) and PID to a
> numeric value. Conversion can of course happen during analysis, but
> since syslog-ng is smart enough to do it when writing data, I prefer
> that.
>
> [1] https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.16/administration-guide/37#TOPIC-956524
Thanks a lot ... I think I will postpone that project ;-)
prev parent reply other threads:[~2020-04-09 8:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-03 11:40 [gentoo-user] aggregate logs into Elasticsearch Stefan G. Weichinger
2020-04-03 15:57 ` Ralph Seichter
2020-04-04 7:43 ` Stefan G. Weichinger
2020-04-04 14:02 ` Ralph Seichter
2020-04-09 8:42 ` Stefan G. Weichinger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e8c414d2-8846-8e2d-0b2f-0749cdbe30a5@xunil.at \
--to=lists@xunil.at \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox