Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Release version 2

  • Loading branch information...
commit 015c68ebff418bf5010a008d9208844d63900bce 1 parent 9013d9f
@josegonzalez authored
View
11 CHANGES.txt
@@ -1 +1,12 @@
+v2, 2012-10-25 -- Second release.
+
+- Updated documentation
+- Added support for `config.ini` based option parsing
+- Refactored transports into separate files
+- Added support for file globbing in paths
+- Added msgpack and regular string output
+- Force UTC time when ingesting logs
+- Refactored logging to use the Python Logging Framework
+- Added RabbitMQ support
+
v1, 2012-08-05 -- Initial release.
View
23 README.rst
@@ -21,30 +21,31 @@ From Github::
From PyPI::
- pip install beaver==1
+ pip install beaver==2
Usage
=====
usage::
- beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH]
- [-f FILES [FILES ...]] [-t TRANSPORT]
+ beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]
+ [-t {rabbitmq,redis,stdout,zmq}] [-c CONFIG] [-d DEBUG]
optional arguments::
-h, --help show this help message and exit
-m {bind,connect}, --mode {bind,connect}
- bind or connect mode
+ bind or connect mode
-p PATH, --path PATH path to log files
-f FILES [FILES ...], --files FILES [FILES ...]
- space-separated filelist to watch. Overrides --path
- argument
- -t/--transport {rabbitmq,redis,stdout,zmq}
- log transport method
- default is stdout
+ space-separated filelist to watch, can include globs
+ (*.log). Overrides --path argument
+ -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}
+ log transport method
-c CONFIG, --configfile CONFIG
- ini config file path
+ ini config file path
+ -d DEBUG, --debug DEBUG
+ enable debug mode
Background
==========
@@ -163,7 +164,7 @@ Todo
* More transports
* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~
* ~Create a python package~
-* Ability to specify files, tags, and other metadata within a configuration file
+* ~Ability to specify files, tags, and other metadata within a configuration file~
Credits
=======
View
23 README.txt
@@ -21,30 +21,31 @@ From Github::
From PyPI::
- pip install beaver==1
+ pip install beaver==2
Usage
=====
usage::
- beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH]
- [-f FILES [FILES ...]] [-t TRANSPORT]
+ beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]
+ [-t {rabbitmq,redis,stdout,zmq}] [-c CONFIG] [-d DEBUG]
optional arguments::
-h, --help show this help message and exit
-m {bind,connect}, --mode {bind,connect}
- bind or connect mode
+ bind or connect mode
-p PATH, --path PATH path to log files
-f FILES [FILES ...], --files FILES [FILES ...]
- space-separated filelist to watch. Overrides --path
- argument
- -t/--transport {rabbitmq,redis,stdout,zmq}
- log transport method
- default is stdout
+ space-separated filelist to watch, can include globs
+ (*.log). Overrides --path argument
+ -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}
+ log transport method
-c CONFIG, --configfile CONFIG
- ini config file path
+ ini config file path
+ -d DEBUG, --debug DEBUG
+ enable debug mode
Background
==========
@@ -163,7 +164,7 @@ Todo
* More transports
* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~
* ~Create a python package~
-* Ability to specify files, tags, and other metadata within a configuration file
+* ~Ability to specify files, tags, and other metadata within a configuration file~
Credits
=======
View
2  beaver/stdout_transport.py
@@ -6,7 +6,7 @@
class StdoutTransport(beaver.transport.Transport):
def callback(self, filename, lines):
- timestamp = datetime.datetime.now().isoformat()
+ timestamp = datetime.datetime.utcnow().isoformat()
for line in lines:
print self.format(filename, timestamp, line)
View
27 bin/beaver
@@ -16,27 +16,26 @@ stdin, zeromq input somewhere down the road to get the events.
Events are sent in logstash's json_event format. Options can
also be set as environment variables.
-Example 1: Listen to all files in the default path of /var/log on standard out
- cli: python beaver.py
+Example 1: Listen to all files in the default path of /var/log on standard out as json
+ cli: beaver
-Example 2: Listen to all .log files /var/log on standard out
- cli: python beaver.py -f /var/log/*.log
+Example 2: Listen to all files in the default path of /var/log on standard out with msgpack
+ cli: BEAVER_FORMAT='msgpack' beaver
-Example 3: Sending logs from /var/log files to a redis list
- cli: REDIS_URL="redis://localhost:6379/0" python beaver.py -t redis
+Example 3: Listen to all files in the default path of /var/log on standard out as a string
+ cli: BEAVER_FORMAT='string' beaver
-Example 4: Use environment variables to send logs from /var/log files to a redis list
- cli: REDIS_URL="redis://localhost:6379/0" BEAVER_PATH="/var/log" BEAVER_TRANSPORT=redis python beaver.py
+Example 4: Sending logs from /var/log files to a redis list
+ cli: REDIS_URL="redis://localhost:6379/0" beaver -t redis
-Example 5: Zeromq listening on port 5556 (all interfaces)
+Example 5: Use environment variables to send logs from /var/log files to a redis list
+ cli: REDIS_URL="redis://localhost:6379/0" BEAVER_PATH="/var/log" BEAVER_TRANSPORT=redis beaver
- cli: ZEROMQ_ADDRESS="tcp://*:5556" python beaver.py -m bind
+Example 6: Zeromq listening on port 5556 (all interfaces)
+ cli: ZEROMQ_ADDRESS="tcp://*:5556" beaver -m bind -t zmq
-Example 6: Zeromq connecting to remote port 5556 on indexer
- cli: ZEROMQ_ADDRESS="tcp://indexer:5556" python beaver.py -m connect
+Please see the readme for more complete examples.
-Example 7: RabbitMQ connecting to defaults on remote broker
- cli: RABBITMQ_HOST="10.0.0.1" python beaver.py -t rabbitmq
"""
parser = argparse.ArgumentParser(description='Beaver logfile shipper',
epilog=epilog_example,
View
2  setup.py
@@ -2,7 +2,7 @@
setup(
name='Beaver',
- version='1',
+ version='2',
author='Jose Diaz-Gonzalez',
author_email='support@savant.be',
packages=['beaver'],
Please sign in to comment.
Something went wrong with that request. Please try again.