Flosculus
Flosculus is a work-in-progress script to tail rotated log file, parse each line, and send it to Fluentd. It is intended to replace a subset of Fluentd in_tail features.
Crash Course
First things first, install Flosculus into your Python path.
$ git clone git://github.com/iromli/flosculus.git
$ cd flosculus
$ python setup.py install
Afterwards you need to create a configuration file to run the flosculusd event loop. The convenient way to do this boring thing is by invoking the flosculusd --init > flosculus.ini command. Here’s an example of flosculus.ini (you can call it whatever you like):
[flosculus]
; the IP address (or host name) of the remote server
remote_host = 127.0.0.1
; the TCP port of the remote server
remote_port = 24224
; Each section with `path:/path/to/log` is a valid config
[log:/var/log/nginx/access.log]
; the label
tag = example.api.access
; format to use, either use 'nginx' or custom regex
format = nginx
By default, the format option is matched against nginx default access log format. You may change the format as long as using a valid Python regex.
[log:/var/log/nginx/access.log]
format = (?P<remote>[^ ]*) (?P<host>[^ ]*) (?P<user>[^ ]*) \[(?P<time>[^\]]*)\] "(?P<method>\S+)(?: +(?P<path>[^\"]*) +\S*)?" (?P<code>[^ ]*) (?P<size>[^ ]*)(?: "(?P<referer>[^\"]*)" "(?P<agent>[^\"]*)")(?: (?P<request_time>[^ ]*) (?P<upstream_time>[^ ]*) (?P<pipe>[\.|p]))?
And did I already mentioned that you can have multiple log files? Simply copy the whole log section.
; Each section with `path:/path/to/log` is a valid config
[log:/var/log/nginx/access.log]
; the label
tag = example.api.access
; format to use, either use 'nginx' or custom regex
format = nginx
; Each section with `path:/path/to/log` is a valid config
[log:/var/log/nginx/timed-combined.access.log]
; the label
tag = test.api.access
; format to use, either use 'nginx' or custom regex
format = (?P<remote>[^ ]*) (?P<host>[^ ]*) (?P<user>[^ ]*) \[(?P<time>[^\]]*)\] "(?P<method>\S+)(?: +(?P<path>[^\"]*) +\S*)?" (?P<code>[^ ]*) (?P<size>[^ ]*)(?: "(?P<referer>[^\"]*)" "(?P<agent>[^\"]*)")(?: (?P<request_time>[^ ]*) (?P<upstream_time>[^ ]*) (?P<pipe>[\.|p]))?
; the IP address (or host name) of the remote server
; use another Fluentd remote host
remote_host = 10.0.0.1
; the TCP port of the remote server
; use another Fluentd remote port
remote_port = 24225
Assuming the configuration is written properly, run the event loop to see its magic (well, not really):
$ flosculusd -c flosculus.ini
Credits
Metadata
Release files for flosculus 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flosculus-0.2.tar.gz | 6.8 kB | Without provenance | Details for flosculus-0.2.tar.gz |
Release files / flosculus-0.2.tar.gz
| Download URL | flosculus-0.2.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc63413c1080c9ee1a3ca17100391bc12bc26ba8bb66162553362b65270fc6c1
|
|
BLAKE2b-256 checksum How to use checksums |
642ae38371b1bfc220f8b0f08528d03cd43b064709dc1942e4165392682096cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for flosculus 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.