Skip to content

Commit

Permalink
Release version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Oct 25, 2012
1 parent 9013d9f commit 015c68e
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 38 deletions.
11 changes: 11 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -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.
23 changes: 12 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
==========
Expand Down Expand Up @@ -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
=======
Expand Down
23 changes: 12 additions & 11 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
==========
Expand Down Expand Up @@ -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
=======
Expand Down
2 changes: 1 addition & 1 deletion beaver/stdout_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
27 changes: 13 additions & 14 deletions bin/beaver
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='Beaver',
version='1',
version='2',
author='Jose Diaz-Gonzalez',
author_email='support@savant.be',
packages=['beaver'],
Expand Down

0 comments on commit 015c68e

Please sign in to comment.