From eb20fc9d37ca9663746b1a1afa696849ddc154fb Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 6 Aug 2012 09:05:26 -0700 Subject: [PATCH 01/14] Create gh-pages branch via GitHub --- images/body-bg.png | Bin 0 -> 8859 bytes images/highlight-bg.jpg | Bin 0 -> 34222 bytes images/hr.png | Bin 0 -> 1037 bytes images/octocat-icon.png | Bin 0 -> 1651 bytes images/tar-gz-icon.png | Bin 0 -> 1671 bytes images/zip-icon.png | Bin 0 -> 1661 bytes index.html | 177 +++++++++++++++++ javascripts/main.js | 1 + params.json | 1 + stylesheets/print.css | 226 +++++++++++++++++++++ stylesheets/pygment_trac.css | 69 +++++++ stylesheets/stylesheet.css | 371 +++++++++++++++++++++++++++++++++++ 12 files changed, 845 insertions(+) create mode 100644 images/body-bg.png create mode 100644 images/highlight-bg.jpg create mode 100644 images/hr.png create mode 100644 images/octocat-icon.png create mode 100644 images/tar-gz-icon.png create mode 100644 images/zip-icon.png create mode 100644 index.html create mode 100644 javascripts/main.js create mode 100644 params.json create mode 100644 stylesheets/print.css create mode 100644 stylesheets/pygment_trac.css create mode 100644 stylesheets/stylesheet.css diff --git a/images/body-bg.png b/images/body-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..d0618fe749178e814554f19fd158dea90020252d GIT binary patch literal 8859 zcmaKS2RPer`!7XN)TXFCiy*etti88dMeHDg*qhp;tyOAkQ7vkVJ!(^%qOn(Ot-YP} zci#8?pL1R3J-NQgciro`pL;yd=Sr-OmNL;J+D8}|7(}Wn3VP^s)ZZ`O1N3h?on0^b zMB}Mw?5Pj4_w)gK*kQ=o!mRC>RH0x8J3TwFt)KgVog@YZmNvw|*wa{317rh(@`3-- z@cBaB(A*dpk}|$-U>j#UPbObLS0JD*MA@LvoQTb;^{2K^1qET*3@B= zhk4jBiSP*lYy^NnCQ(s7psYkZK0bUtLVPd}2Y#T0gv4JNf`R}v1pw~n>IwD*xWZZgEkVH! zZsP%Q^Mt@$nf^)y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|)M})R5-W@E$61G; zwa^L$|46?>*^dmheBu3H*%cDMQ@<4Fb{JVVtjquP;_MsWrp+~uGDv?mebC0h}9bj|r6j9Sj=paWEDn9(_saCj6 zmroyy9yCuFS$py!b~TD)HAXn`BP+IP#`HlO!gK4VCqG=T3V+%^<;B-H?sB303kdW_ zE^qk6CBi-m{z0hUUV3nO+yFGl{ zWFIre7$4hPh?4E^7;_LGW0!~xC!9;J*7iC(sJ;|m{REfOs^62A`Vpb^&*i|&eCFJ9b3l=K7}r zDEQ?ovU7*0(vV{9=A{Ad%!n$Cmz;f`T!Nn(L*ze1`vuoNLUkWyHjLfF*XYX7Ev|x~ zmq)zB&Q5cM)`~?YtKsw=J9fM4;IUMC!vJ4=Q2j8jc1Cult&yeKv5g&Gly}k=L^mac z0rJhMlWJYcP{H$UFY&`7`&Zib$}l0>XD2>YCz0y|L0Zs<&Xaj DGStm7 literal 0 HcmV?d00001 diff --git a/images/hr.png b/images/hr.png new file mode 100644 index 0000000000000000000000000000000000000000..6c723a5602e14caa5c1527f3226d383dc83db6bd GIT binary patch literal 1037 zcmaJ=O=#3W6ppP(DfA#BSfMzksBP)ycawF8u4S8S+eOos-GGZH(`4F>Z89;Lx@kQW zdXeJMs}{wJ7kd-LA_{_7ym;tIym;!NSV8EeAUN6XZauh$A$c>r?|a{Td2fAYYNDt6 zd^f`|J;h1A#4sICXndmU6n#J5Kg-ikFDX<=8PAcL6(T0@;8_HUo;8n3$a0qNZle)~ z>6~`W3aJ=3pp8AwN^-c^3n-dlMn>bnvKJ5mvuNJ+bL`KpcPwz79D7qS1S8N;)ty`k zQF&#`v{x4Ftiz6810yk{1Rf$5h`mKWf^m+m^FkUY$2<$_DP$qX9*L?LGeE;30tzRm zY(W%(s&ZmlQB`pmNP;Nw0$plKOhZM5QU)|0mR1X$Iat!i8@1>z$5sgmAkWuoHLfOe zIGpFjY&M&4NK%Ssq@rb?SaHga`kM?oitNx0h>LxYFj}*CiR4(S^yms+(4zIDhE3Ek zKDGj0o(%|yfaf2!xTvLjML$9n%s9GS}j;!7yPOQB7F++2TBDu7yuEP_K584fa+@981e_uIs?OtVl{m%4Q@jEs6zkOwY@OLYf|Fijp4Jnphp%OCIt`6YCsf^KG$7 z-*^G7tfSDqhn(>cd!X(QblYpmwB>7Ho%UL;w#D*P44-ttUtQ5WqOF#MtsbYF)|4Qh zjz&mlVDsTNN9V^Z>UlH%x?^tlFhbYb?*||IhKCM5Kf8Fk0~~&sex2TTgpC(J4*mO= zclX|($v%4f<@?sbt)0D3^7`}qYTq~YRe7TK%AHKGyE^n#+j#TxU#ywo|pap6}o NpvA(JzBzV#?GKcZMQ8v3 literal 0 HcmV?d00001 diff --git a/images/octocat-icon.png b/images/octocat-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f0ba137d268da4921d9f4b5905bed9e724c45770 GIT binary patch literal 1651 zcmaJ?c~BE)6i=&CmBQF^2nEWrRFJ9JBd4qc2uXlggBYSN(Tn>AeFtZ9Loln#Vl${5)?uJ=p4?0saX?KPa&awg zFc&R7kH_(N82pGZkA*v1TwK9*A>d907^52Ea*LZ4Bm=fkV6)H}`DAATZ>@ zT4dlqNo8r$0R=_lfEW_;O$dqt5($Kg#1aWQ0}vpn07f{I@KF&amS6%YF#LdAG}@el zX_d*tvAC5C%wt(Q2Ez`A19Au-$uuPm_u+w0NQ3&xIX~a>Z`F~fE9Q9^cE&d|k|0HH~ zMRpw4;tW+lo4AY1iS&fBV+tBKuoSJMDC>xd>3I}OF?p07P-IAe>8KDwhQvdJh!`Rv z5h@cOuk{PdF)(7V`5=08Q4<=|Eh|SEw0o&)6p8|7NcE)+ql-CxgNL~{kDY1d-=Fp zDc3oB>leI}=Qq#)lu$kXoA4^5=2=gorNKL4ci_7i)L=wGH~hHrS@&5 z{m1Ldg2S$K1Q|oxdI)uHWzM=2_kzInDcSO*kK$e9jmdrEbMl(z+L_tqo9lS*i_}kn z!;@N9MLo*)+f`bgcsnp+M^wTG5zUK1AH_N*J}0%g(JT*JQJ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{({|yn>rg?wMnwQjb1x9YttBn36WbE>+E&hT$BO62Ch56cR S7rUr~Dg;kgKbLh*2~7YV%7O|2 literal 0 HcmV?d00001 diff --git a/index.html b/index.html new file mode 100644 index 00000000..c57f9c0c --- /dev/null +++ b/index.html @@ -0,0 +1,177 @@ + + + + + + + + + + + Beaver by josegonzalez + + + +
+
+ +
+

Beaver

+

python daemon that munches on logs and sends their contents to logstash

+
+ +
+ Download .zip + Download .tar.gz + View on GitHub +
+ +
+ +
+

Requirements

+ +
    +
  • Python 2.7 (untested on other versions)
  • +
  • libzmq (brew install zmq or apt-get install libzmq-dev)
  • +

Installation

+ +

Using PIP:

+ +

From Github::

+ +
pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver
+
+ +

From PyPI::

+ +
pip install beaver==1
+
+ +

Usage

+ +

usage::

+ +
beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH]
+                 [-f FILES [FILES ...]] [-t TRANSPORT]
+
+ +

optional arguments::

+ +
-h, --help            show this help message and exit
+-m {bind,connect}, --mode {bind,connect}
+                      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 {amqp,redis,stdout}, --transport {amqp,redis,stdout}
+                  log transport method
+
+ +

Background

+ +

Beaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, 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.

+ +

Examples

+ +

Example 1: Listen to all files in the default path of /var/log on standard out::

+ +
beaver
+
+ +

Example 2: Sending logs from /var/log files to a redis list::

+ +
REDIS_URL="redis://localhost:6379/0" beaver -t redis
+
+ +

Example 3: Use environment variables to send logs from /var/log files to a redis list::

+ +
REDIS_URL="redis://localhost:6379/0" BEAVER_PATH="/var/log" BEAVER_TRANSPORT=redis beaver
+
+ +

Example 4: Zeromq listening on port 5556 (all interfaces)::

+ +
ZEROMQ_ADDRESS="tcp://*:5556" beaver -m bind
+
+# logstash config:
+input { zeromq {
+    type => 'shipper-input'
+    mode => 'client'
+    topology => 'pushpull'
+    address => 'tcp://shipperhost:5556'
+  } }
+output { stdout { debug => true } }
+
+ +

Example 5: Zeromq connecting to remote port 5556 on indexer::

+ +
ZEROMQ_ADDRESS="tcp://indexer:5556" beaver -m connect
+
+# logstash config:
+input { zeromq {
+    type => 'shipper-input'
+    mode => 'server'
+    topology => 'pushpull'
+    address => 'tcp://*:5556'
+  }}
+output { stdout { debug => true } }
+
+ +

Example 6: Real-world usage of Redis as a transport::

+ +
# in /etc/hosts
+192.168.0.10 redis-internal
+
+# From the commandline
+REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis
+
+# logstash indexer config:
+redis {
+    host => 'redis-internal' # this is in dns for work
+    data_type => 'list'
+    key => 'app:unmappable'
+    type => 'app:unmappable'
+}
+
+ +

As you can see, beaver is pretty flexible as to how you can use/abuse it in production.

+ +

Todo

+ +
    +
  • Use python threading + subprocess in order to support usage of yield across all operating systems
  • +
  • Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution
  • +
  • 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
  • +

Credits

+ +

Based on work from Giampaolo and Lusis::

+ +
Real time log files watcher supporting log rotation.
+
+Original Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com>
+http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/
+
+License: MIT
+
+Other hacks (ZMQ, JSON, optparse, ...): lusis
+
+
+ + + + +
+
+ + \ No newline at end of file diff --git a/javascripts/main.js b/javascripts/main.js new file mode 100644 index 00000000..d8135d37 --- /dev/null +++ b/javascripts/main.js @@ -0,0 +1 @@ +console.log('This would be the main JS file.'); diff --git a/params.json b/params.json new file mode 100644 index 00000000..30525e90 --- /dev/null +++ b/params.json @@ -0,0 +1 @@ +{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","google":"","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==1\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH]\r\n [-f FILES [FILES ...]] [-t TRANSPORT]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch. Overrides --path\r\n argument\r\n -t {amqp,redis,stdout}, --transport {amqp,redis,stdout}\r\n log transport method\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out::\r\n\r\n beaver\r\n\r\nExample 2: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 3: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 4: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 5: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 6: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~\r\n* ~Create a python package~\r\n* Ability to specify files, tags, and other metadata within a configuration file\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","tagline":"python daemon that munches on logs and sends their contents to logstash"} \ No newline at end of file diff --git a/stylesheets/print.css b/stylesheets/print.css new file mode 100644 index 00000000..541695bf --- /dev/null +++ b/stylesheets/print.css @@ -0,0 +1,226 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +body { + font-size: 13px; + line-height: 1.5; + font-family: 'Helvetica Neue', Helvetica, Arial, serif; + color: #000; +} + +a { + color: #d5000d; + font-weight: bold; +} + +header { + padding-top: 35px; + padding-bottom: 10px; +} + +header h1 { + font-weight: bold; + letter-spacing: -1px; + font-size: 48px; + color: #303030; + line-height: 1.2; +} + +header h2 { + letter-spacing: -1px; + font-size: 24px; + color: #aaa; + font-weight: normal; + line-height: 1.3; +} +#downloads { + display: none; +} +#main_content { + padding-top: 20px; +} + +code, pre { + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal; + color: #222; + margin-bottom: 30px; + font-size: 12px; +} + +code { + padding: 0 3px; +} + +pre { + border: solid 1px #ddd; + padding: 20px; + overflow: auto; +} +pre code { + padding: 0; +} + +ul, ol, dl { + margin-bottom: 20px; +} + + +/* COMMON STYLES */ + +table { + width: 100%; + border: 1px solid #ebebeb; +} + +th { + font-weight: 500; +} + +td { + border: 1px solid #ebebeb; + text-align: center; + font-weight: 300; +} + +form { + background: #f2f2f2; + padding: 20px; + +} + + +/* GENERAL ELEMENT TYPE STYLES */ + +h1 { + font-size: 2.8em; +} + +h2 { + font-size: 22px; + font-weight: bold; + color: #303030; + margin-bottom: 8px; +} + +h3 { + color: #d5000d; + font-size: 18px; + font-weight: bold; + margin-bottom: 8px; +} + +h4 { + font-size: 16px; + color: #303030; + font-weight: bold; +} + +h5 { + font-size: 1em; + color: #303030; +} + +h6 { + font-size: .8em; + color: #303030; +} + +p { + font-weight: 300; + margin-bottom: 20px; +} + +a { + text-decoration: none; +} + +p a { + font-weight: 400; +} + +blockquote { + font-size: 1.6em; + border-left: 10px solid #e9e9e9; + margin-bottom: 20px; + padding: 0 0 0 30px; +} + +ul li { + list-style: disc inside; + padding-left: 20px; +} + +ol li { + list-style: decimal inside; + padding-left: 3px; +} + +dl dd { + font-style: italic; + font-weight: 100; +} + +footer { + margin-top: 40px; + padding-top: 20px; + padding-bottom: 30px; + font-size: 13px; + color: #aaa; +} + +footer a { + color: #666; +} + +/* MISC */ +.clearfix:after { + clear: both; + content: '.'; + display: block; + visibility: hidden; + height: 0; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} \ No newline at end of file diff --git a/stylesheets/pygment_trac.css b/stylesheets/pygment_trac.css new file mode 100644 index 00000000..c6a6452d --- /dev/null +++ b/stylesheets/pygment_trac.css @@ -0,0 +1,69 @@ +.highlight { background: #ffffff; } +.highlight .c { color: #999988; font-style: italic } /* Comment */ +.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.highlight .k { font-weight: bold } /* Keyword */ +.highlight .o { font-weight: bold } /* Operator */ +.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ +.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ +.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #aa0000 } /* Generic.Error */ +.highlight .gh { color: #999999 } /* Generic.Heading */ +.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ +.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #555555 } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */ +.highlight .gt { color: #aa0000 } /* Generic.Traceback */ +.highlight .kc { font-weight: bold } /* Keyword.Constant */ +.highlight .kd { font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ +.highlight .m { color: #009999 } /* Literal.Number */ +.highlight .s { color: #d14 } /* Literal.String */ +.highlight .na { color: #008080 } /* Name.Attribute */ +.highlight .nb { color: #0086B3 } /* Name.Builtin */ +.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ +.highlight .no { color: #008080 } /* Name.Constant */ +.highlight .ni { color: #800080 } /* Name.Entity */ +.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ +.highlight .nn { color: #555555 } /* Name.Namespace */ +.highlight .nt { color: #000080 } /* Name.Tag */ +.highlight .nv { color: #008080 } /* Name.Variable */ +.highlight .ow { font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #009999 } /* Literal.Number.Float */ +.highlight .mh { color: #009999 } /* Literal.Number.Hex */ +.highlight .mi { color: #009999 } /* Literal.Number.Integer */ +.highlight .mo { color: #009999 } /* Literal.Number.Oct */ +.highlight .sb { color: #d14 } /* Literal.String.Backtick */ +.highlight .sc { color: #d14 } /* Literal.String.Char */ +.highlight .sd { color: #d14 } /* Literal.String.Doc */ +.highlight .s2 { color: #d14 } /* Literal.String.Double */ +.highlight .se { color: #d14 } /* Literal.String.Escape */ +.highlight .sh { color: #d14 } /* Literal.String.Heredoc */ +.highlight .si { color: #d14 } /* Literal.String.Interpol */ +.highlight .sx { color: #d14 } /* Literal.String.Other */ +.highlight .sr { color: #009926 } /* Literal.String.Regex */ +.highlight .s1 { color: #d14 } /* Literal.String.Single */ +.highlight .ss { color: #990073 } /* Literal.String.Symbol */ +.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #008080 } /* Name.Variable.Class */ +.highlight .vg { color: #008080 } /* Name.Variable.Global */ +.highlight .vi { color: #008080 } /* Name.Variable.Instance */ +.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ + +.type-csharp .highlight .k { color: #0000FF } +.type-csharp .highlight .kt { color: #0000FF } +.type-csharp .highlight .nf { color: #000000; font-weight: normal } +.type-csharp .highlight .nc { color: #2B91AF } +.type-csharp .highlight .nn { color: #000000 } +.type-csharp .highlight .s { color: #A31515 } +.type-csharp .highlight .sc { color: #A31515 } diff --git a/stylesheets/stylesheet.css b/stylesheets/stylesheet.css new file mode 100644 index 00000000..020ad6dc --- /dev/null +++ b/stylesheets/stylesheet.css @@ -0,0 +1,371 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* LAYOUT STYLES */ +body { + font-size: 1em; + line-height: 1.5; + background: #e7e7e7 url(../images/body-bg.png) 0 0 repeat; + font-family: 'Helvetica Neue', Helvetica, Arial, serif; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); + color: #6d6d6d; +} + +a { + color: #d5000d; +} +a:hover { + color: #c5000c; +} + +header { + padding-top: 35px; + padding-bottom: 25px; +} + +header h1 { + font-family: 'Chivo', 'Helvetica Neue', Helvetica, Arial, serif; font-weight: 900; + letter-spacing: -1px; + font-size: 48px; + color: #303030; + line-height: 1.2; +} + +header h2 { + letter-spacing: -1px; + font-size: 24px; + color: #aaa; + font-weight: normal; + line-height: 1.3; +} + +#container { + background: transparent url(../images/highlight-bg.jpg) 50% 0 no-repeat; + min-height: 595px; +} + +.inner { + width: 620px; + margin: 0 auto; +} + +#container .inner img { + max-width: 100%; +} + +#downloads { + margin-bottom: 40px; +} + +a.button { + -moz-border-radius: 30px; + -webkit-border-radius: 30px; + border-radius: 30px; + border-top: solid 1px #cbcbcb; + border-left: solid 1px #b7b7b7; + border-right: solid 1px #b7b7b7; + border-bottom: solid 1px #b3b3b3; + color: #303030; + line-height: 25px; + font-weight: bold; + font-size: 15px; + padding: 12px 8px 12px 8px; + display: block; + float: left; + width: 179px; + margin-right: 14px; + background: #fdfdfd; /* Old browsers */ + background: -moz-linear-gradient(top, #fdfdfd 0%, #f2f2f2 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f2f2f2)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* IE10+ */ + background: linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f2f2f2',GradientType=0 ); /* IE6-9 */ + -webkit-box-shadow: 10px 10px 5px #888; + -moz-box-shadow: 10px 10px 5px #888; + box-shadow: 0px 1px 5px #e8e8e8; +} +a.button:hover { + border-top: solid 1px #b7b7b7; + border-left: solid 1px #b3b3b3; + border-right: solid 1px #b3b3b3; + border-bottom: solid 1px #b3b3b3; + background: #fafafa; /* Old browsers */ + background: -moz-linear-gradient(top, #fdfdfd 0%, #f6f6f6 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* IE10+ */ + background: linear-gradient(top, #fdfdfd 0%,#f6f6f6, 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */ +} + +a.button span { + padding-left: 50px; + display: block; + height: 23px; +} + +#download-zip span { + background: transparent url(../images/zip-icon.png) 12px 50% no-repeat; +} +#download-tar-gz span { + background: transparent url(../images/tar-gz-icon.png) 12px 50% no-repeat; +} +#view-on-github span { + background: transparent url(../images/octocat-icon.png) 12px 50% no-repeat; +} +#view-on-github { + margin-right: 0; +} + +code, pre { + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal; + color: #222; + margin-bottom: 30px; + font-size: 14px; +} + +code { + background-color: #f2f2f2; + border: solid 1px #ddd; + padding: 0 3px; +} + +pre { + padding: 20px; + background: #303030; + color: #f2f2f2; + text-shadow: none; + overflow: auto; +} +pre code { + color: #f2f2f2; + background-color: #303030; + border: none; + padding: 0; +} + +ul, ol, dl { + margin-bottom: 20px; +} + + +/* COMMON STYLES */ + +hr { + height: 1px; + line-height: 1px; + margin-top: 1em; + padding-bottom: 1em; + border: none; + background: transparent url('../images/hr.png') 50% 0 no-repeat; +} + +strong { + font-weight: bold; +} + +em { + font-style: italic; +} + +table { + width: 100%; + border: 1px solid #ebebeb; +} + +th { + font-weight: 500; +} + +td { + border: 1px solid #ebebeb; + text-align: center; + font-weight: 300; +} + +form { + background: #f2f2f2; + padding: 20px; + +} + + +/* GENERAL ELEMENT TYPE STYLES */ + +h1 { + font-size: 32px; +} + +h2 { + font-size: 22px; + font-weight: bold; + color: #303030; + margin-bottom: 8px; +} + +h3 { + color: #d5000d; + font-size: 18px; + font-weight: bold; + margin-bottom: 8px; +} + +h4 { + font-size: 16px; + color: #303030; + font-weight: bold; +} + +h5 { + font-size: 1em; + color: #303030; +} + +h6 { + font-size: .8em; + color: #303030; +} + +p { + font-weight: 300; + margin-bottom: 20px; +} + +a { + text-decoration: none; +} + +p a { + font-weight: 400; +} + +blockquote { + font-size: 1.6em; + border-left: 10px solid #e9e9e9; + margin-bottom: 20px; + padding: 0 0 0 30px; +} + +ul li { + list-style: disc inside; + padding-left: 20px; +} + +ol li { + list-style: decimal inside; + padding-left: 3px; +} + +dl dt { + color: #303030; +} + +footer { + background: transparent url('../images/hr.png') 0 0 no-repeat; + margin-top: 40px; + padding-top: 20px; + padding-bottom: 30px; + font-size: 13px; + color: #aaa; +} + +footer a { + color: #666; +} +footer a:hover { + color: #444; +} + +/* MISC */ +.clearfix:after { + clear: both; + content: '.'; + display: block; + visibility: hidden; + height: 0; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} + +/* #Media Queries +================================================== */ + +/* Smaller than standard 960 (devices and browsers) */ +@media only screen and (max-width: 959px) {} + +/* Tablet Portrait size to standard 960 (devices and browsers) */ +@media only screen and (min-width: 768px) and (max-width: 959px) {} + +/* All Mobile Sizes (devices and browser) */ +@media only screen and (max-width: 767px) { + header { + padding-top: 10px; + padding-bottom: 10px; + } + #downloads { + margin-bottom: 25px; + } + #download-zip, #download-tar-gz { + display: none; + } + .inner { + width: 94%; + margin: 0 auto; + } +} + +/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ +@media only screen and (min-width: 480px) and (max-width: 767px) {} + +/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */ +@media only screen and (max-width: 479px) {} From 8e19b62f666d29dcbcbcea807ab03c29cae64e1e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 13 Aug 2012 07:58:56 -0700 Subject: [PATCH 02/14] Create gh-pages branch via GitHub --- index.html | 18 ++++++++++++++++++ params.json | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index c57f9c0c..db889edd 100644 --- a/index.html +++ b/index.html @@ -141,6 +141,24 @@

Examples

As you can see, beaver is pretty flexible as to how you can use/abuse it in production.

+

Example 7: RabbitMQ connecting to defaults on remote broker

+ +
RABBITMQ_ADDRESS="10.0.0.1" beaver -t rabbitmq
+
+# logstash config:
+input { amqp {
+    name => "logstash-queue"
+    type => "direct"
+    host => "10.0.0.1"
+    exchange => "logstash-exchange"
+    key => "logstash-key"
+    exclusive => false
+    durable => false
+    auto_delete => false
+  }}
+output { stdout { debug => "true" }}
+
+

Todo

    diff --git a/params.json b/params.json index 30525e90..d9a6b3b1 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","google":"","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==1\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH]\r\n [-f FILES [FILES ...]] [-t TRANSPORT]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch. Overrides --path\r\n argument\r\n -t {amqp,redis,stdout}, --transport {amqp,redis,stdout}\r\n log transport method\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out::\r\n\r\n beaver\r\n\r\nExample 2: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 3: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 4: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 5: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 6: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~\r\n* ~Create a python package~\r\n* Ability to specify files, tags, and other metadata within a configuration file\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","tagline":"python daemon that munches on logs and sends their contents to logstash"} \ No newline at end of file +{"tagline":"python daemon that munches on logs and sends their contents to logstash","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==1\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH]\r\n [-f FILES [FILES ...]] [-t TRANSPORT]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch. Overrides --path\r\n argument\r\n -t {amqp,redis,stdout}, --transport {amqp,redis,stdout}\r\n log transport method\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out::\r\n\r\n beaver\r\n\r\nExample 2: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 3: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 4: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 5: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 6: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 7: RabbitMQ connecting to defaults on remote broker\r\n\r\n RABBITMQ_ADDRESS=\"10.0.0.1\" beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => \"logstash-queue\"\r\n type => \"direct\"\r\n host => \"10.0.0.1\"\r\n exchange => \"logstash-exchange\"\r\n key => \"logstash-key\"\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~\r\n* ~Create a python package~\r\n* Ability to specify files, tags, and other metadata within a configuration file\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","google":""} \ No newline at end of file From c854994127e3ad30e288f10bc2b8058111c8cb21 Mon Sep 17 00:00:00 2001 From: librato-peter Date: Wed, 19 Sep 2012 23:22:31 -0300 Subject: [PATCH 03/14] Update index.html Updating docs for zmq transport method --- index.html | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 167 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index db889edd..8fb137a6 100644 --- a/index.html +++ b/index.html @@ -67,8 +67,171 @@

    Usage

    -f FILES [FILES ...], --files FILES [FILES ...] space-separated filelist to watch. Overrides --path argument --t {amqp,redis,stdout}, --transport {amqp,redis,stdout} - log transport method + +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +====== +Beaver +====== + +python daemon that munches on logs and sends their contents to logstash + +Requirements +============ + +* Python 2.7 (untested on other versions) +* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) + +Installation +============ + +Using PIP: + +From Github:: + + pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver + +From PyPI:: + + pip install beaver==1 + +Usage +===== + +usage:: + + beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH] + [-f FILES [FILES ...]] [-t TRANSPORT] + +optional arguments:: + + -h, --help show this help message and exit + -m {bind,connect}, --mode {bind,connect} + 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

    Background

    @@ -96,7 +259,7 @@

    Examples

    Example 4: Zeromq listening on port 5556 (all interfaces)::

    -
    ZEROMQ_ADDRESS="tcp://*:5556" beaver -m bind
    +
    ZEROMQ_ADDRESS="tcp://*:5556" beaver -m bind -t zmq
     
     # logstash config:
     input { zeromq {
    @@ -110,7 +273,7 @@ 

    Examples

    Example 5: Zeromq connecting to remote port 5556 on indexer::

    -
    ZEROMQ_ADDRESS="tcp://indexer:5556" beaver -m connect
    +
    ZEROMQ_ADDRESS="tcp://indexer:5556" beaver -m connect -t zmq
     
     # logstash config:
     input { zeromq {
    
    From 30f9c1963c19aa38c20d6bf7a4ab94a0101fb2fd Mon Sep 17 00:00:00 2001
    From: librato-peter 
    Date: Thu, 20 Sep 2012 18:08:35 -0300
    Subject: [PATCH 04/14] Update index.html
    
    Fixed bad copy-paste job.
    ---
     index.html | 164 +----------------------------------------------------
     1 file changed, 1 insertion(+), 163 deletions(-)
    
    diff --git a/index.html b/index.html
    index 8fb137a6..a1d7ee86 100644
    --- a/index.html
    +++ b/index.html
    @@ -67,169 +67,7 @@ 

    Usage

    -f FILES [FILES ...], --files FILES [FILES ...] space-separated filelist to watch. Overrides --path argument - -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -====== -Beaver -====== - -python daemon that munches on logs and sends their contents to logstash - -Requirements -============ - -* Python 2.7 (untested on other versions) -* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) - -Installation -============ - -Using PIP: - -From Github:: - - pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver - -From PyPI:: - - pip install beaver==1 - -Usage -===== - -usage:: - - beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH] - [-f FILES [FILES ...]] [-t TRANSPORT] - -optional arguments:: - - -h, --help show this help message and exit - -m {bind,connect}, --mode {bind,connect} - 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} +-t/--transport {rabbitmq,redis,stdout,zmq} log transport method default is stdout
    From 900638f9114894df53f4385439a206d662dc454c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 25 Oct 2012 20:03:01 -0700 Subject: [PATCH 05/14] Create gh-pages branch via GitHub --- index.html | 54 +++++++++++++++++++++++++++++++++++++++++------------ params.json | 2 +- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index a1d7ee86..2a4d0b3d 100644 --- a/index.html +++ b/index.html @@ -68,8 +68,10 @@

    Usage

    space-separated filelist to watch. Overrides --path argument -t/--transport {rabbitmq,redis,stdout,zmq} - log transport method - default is stdout + log transport method + default is stdout +-c CONFIG, --configfile CONFIG + ini config file path

    Background

    @@ -80,22 +82,32 @@

    Background

    Examples

    -

    Example 1: Listen to all files in the default path of /var/log on standard out::

    +

    Example 1: Listen to all files in the default path of /var/log on standard out as json::

    beaver
     
    -

    Example 2: Sending logs from /var/log files to a redis list::

    +

    Example 2: Listen to all files in the default path of /var/log on standard out with msgpack::

    + +
    BEAVER_FORMAT='msgpack' beaver
    +
    + +

    Example 3: Listen to all files in the default path of /var/log on standard out as a string::

    + +
    BEAVER_FORMAT='string' beaver
    +
    + +

    Example 4: Sending logs from /var/log files to a redis list::

    REDIS_URL="redis://localhost:6379/0" beaver -t redis
     
    -

    Example 3: Use environment variables to send logs from /var/log files to a redis list::

    +

    Example 5: Use environment variables to send logs from /var/log files to a redis list::

    REDIS_URL="redis://localhost:6379/0" BEAVER_PATH="/var/log" BEAVER_TRANSPORT=redis beaver
     
    -

    Example 4: Zeromq listening on port 5556 (all interfaces)::

    +

    Example 6: Zeromq listening on port 5556 (all interfaces)::

    ZEROMQ_ADDRESS="tcp://*:5556" beaver -m bind -t zmq
     
    @@ -109,7 +121,7 @@ 

    Examples

    output { stdout { debug => true } }
    -

    Example 5: Zeromq connecting to remote port 5556 on indexer::

    +

    Example 7: Zeromq connecting to remote port 5556 on indexer::

    ZEROMQ_ADDRESS="tcp://indexer:5556" beaver -m connect -t zmq
     
    @@ -123,7 +135,7 @@ 

    Examples

    output { stdout { debug => true } }
    -

    Example 6: Real-world usage of Redis as a transport::

    +

    Example 8: Real-world usage of Redis as a transport::

    # in /etc/hosts
     192.168.0.10 redis-internal
    @@ -132,19 +144,21 @@ 

    Examples

    REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis # logstash indexer config: -redis { +input { redis { host => 'redis-internal' # this is in dns for work data_type => 'list' key => 'app:unmappable' type => 'app:unmappable' -} +}} +output { stdout { debug => "true" }}

    As you can see, beaver is pretty flexible as to how you can use/abuse it in production.

    -

    Example 7: RabbitMQ connecting to defaults on remote broker

    +

    Example 9: RabbitMQ connecting to defaults on remote broker::

    -
    RABBITMQ_ADDRESS="10.0.0.1" beaver -t rabbitmq
    +
    # From the commandline
    +RABBITMQ_HOST="10.0.0.1" beaver -t rabbitmq
     
     # logstash config:
     input { amqp {
    @@ -160,6 +174,22 @@ 

    Examples

    output { stdout { debug => "true" }}
    +

    Example 10: Read config from config.ini and put to stdout::

    + +
    # From the commandline
    +beaver -c config.ini -t stdout
    +
    +# config.ini content:
    +[/tmp/somefile]
    +type: mytype
    +tags: tag1,tag2
    +add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]
    +
    +[/var/log/*log]
    +type: syslog
    +tags: sys
    +
    +

    Todo

      diff --git a/params.json b/params.json index d9a6b3b1..770e8b7e 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"tagline":"python daemon that munches on logs and sends their contents to logstash","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==1\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH]\r\n [-f FILES [FILES ...]] [-t TRANSPORT]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch. Overrides --path\r\n argument\r\n -t {amqp,redis,stdout}, --transport {amqp,redis,stdout}\r\n log transport method\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out::\r\n\r\n beaver\r\n\r\nExample 2: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 3: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 4: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 5: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 6: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 7: RabbitMQ connecting to defaults on remote broker\r\n\r\n RABBITMQ_ADDRESS=\"10.0.0.1\" beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => \"logstash-queue\"\r\n type => \"direct\"\r\n host => \"10.0.0.1\"\r\n exchange => \"logstash-exchange\"\r\n key => \"logstash-key\"\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~\r\n* ~Create a python package~\r\n* Ability to specify files, tags, and other metadata within a configuration file\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","google":""} \ No newline at end of file +{"name":"Beaver","google":"","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==1\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH]\r\n [-f FILES [FILES ...]] [-t TRANSPORT]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch. Overrides --path\r\n argument\r\n -t/--transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n default is stdout\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input { redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST=\"10.0.0.1\" beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => \"logstash-queue\"\r\n type => \"direct\"\r\n host => \"10.0.0.1\"\r\n exchange => \"logstash-exchange\"\r\n key => \"logstash-key\"\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~\r\n* ~Create a python package~\r\n* Ability to specify files, tags, and other metadata within a configuration file\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","note":"Don't delete this file! It's used internally to help with page regeneration.","tagline":"python daemon that munches on logs and sends their contents to logstash"} \ No newline at end of file From 7027868afc46cd8c3819b309115fb7f5216d5866 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 25 Oct 2012 20:04:43 -0700 Subject: [PATCH 06/14] Create gh-pages branch via GitHub --- index.html | 23 ++++++++++++----------- params.json | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index 2a4d0b3d..b443b986 100644 --- a/index.html +++ b/index.html @@ -47,31 +47,32 @@

      Requirements

      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

      @@ -198,7 +199,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

    Based on work from Giampaolo and Lusis::

    diff --git a/params.json b/params.json index 770e8b7e..24e83800 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"name":"Beaver","google":"","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==1\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-r {worker,interactive}] [-m {bind,connect}] [-p PATH]\r\n [-f FILES [FILES ...]] [-t TRANSPORT]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch. Overrides --path\r\n argument\r\n -t/--transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n default is stdout\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input { redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST=\"10.0.0.1\" beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => \"logstash-queue\"\r\n type => \"direct\"\r\n host => \"10.0.0.1\"\r\n exchange => \"logstash-exchange\"\r\n key => \"logstash-key\"\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~\r\n* ~Create a python package~\r\n* Ability to specify files, tags, and other metadata within a configuration file\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","note":"Don't delete this file! It's used internally to help with page regeneration.","tagline":"python daemon that munches on logs and sends their contents to logstash"} \ No newline at end of file +{"name":"Beaver","google":"","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==2\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq}] [-c CONFIG] [-d DEBUG]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d DEBUG, --debug DEBUG\r\n enable debug mode\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input { redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST=\"10.0.0.1\" beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => \"logstash-queue\"\r\n type => \"direct\"\r\n host => \"10.0.0.1\"\r\n exchange => \"logstash-exchange\"\r\n key => \"logstash-key\"\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~\r\n* ~Create a python package~\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","note":"Don't delete this file! It's used internally to help with page regeneration.","tagline":"python daemon that munches on logs and sends their contents to logstash"} \ No newline at end of file From 95937faa118c8a67dce0b094e7cefbff68724b2a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 25 Nov 2012 18:27:46 -0800 Subject: [PATCH 07/14] Create gh-pages branch via GitHub --- index.html | 23 +++++++++++++++++++---- params.json | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index b443b986..5b2adef2 100644 --- a/index.html +++ b/index.html @@ -35,7 +35,7 @@

    Requirements

    • Python 2.7 (untested on other versions)
    • -
    • libzmq (brew install zmq or apt-get install libzmq-dev)
    • +
    • Optional zeromq support: install libzmq (brew install zmq or apt-get install libzmq-dev) and pyzmq (pip install pyzmq==2.1.11)

    Installation

    Using PIP:

    @@ -47,7 +47,7 @@

    Requirements

    From PyPI::

    -
    pip install beaver==2
    +
    pip install beaver==3
     

    Usage

    @@ -55,7 +55,7 @@

    Usage

    usage::

    beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]
    -          [-t {rabbitmq,redis,stdout,zmq}] [-c CONFIG] [-d DEBUG]
    +          [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG]
     

    optional arguments::

    @@ -191,13 +191,28 @@

    Examples

    tags: sys
    +

    Example 11: UDP transport::

    + +
    # From the commandline
    +UDP_HOST="127.0.0.1" UDP_PORT="9999" beaver -t udp
    +
    +# logstash config:
    +input {
    +  udp {
    +    type => "shipper-input"
    +    host => "127.0.0.1"
    +    port => "9999"
    +  }
    +}
    +output { stdout { debug => "true" }}
    +
    +

    Todo

    • Use python threading + subprocess in order to support usage of yield across all operating systems
    • Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution
    • 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~

    Credits

    diff --git a/params.json b/params.json index 24e83800..812f034d 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"name":"Beaver","google":"","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==2\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq}] [-c CONFIG] [-d DEBUG]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d DEBUG, --debug DEBUG\r\n enable debug mode\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input { redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST=\"10.0.0.1\" beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => \"logstash-queue\"\r\n type => \"direct\"\r\n host => \"10.0.0.1\"\r\n exchange => \"logstash-exchange\"\r\n key => \"logstash-key\"\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Separate tranports into different files so that individual transport requirements are not required on all installations (libzmq)~\r\n* ~Create a python package~\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","note":"Don't delete this file! It's used internally to help with page regeneration.","tagline":"python daemon that munches on logs and sends their contents to logstash"} \ No newline at end of file +{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","tagline":"python daemon that munches on logs and sends their contents to logstash","google":"","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==3\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d DEBUG, --debug DEBUG\r\n enable debug mode\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input { redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST=\"10.0.0.1\" beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => \"logstash-queue\"\r\n type => \"direct\"\r\n host => \"10.0.0.1\"\r\n exchange => \"logstash-exchange\"\r\n key => \"logstash-key\"\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\nExample 11: UDP transport::\r\n\r\n # From the commandline\r\n UDP_HOST=\"127.0.0.1\" UDP_PORT=\"9999\" beaver -t udp\r\n\r\n # logstash config:\r\n input {\r\n udp {\r\n type => \"shipper-input\"\r\n host => \"127.0.0.1\"\r\n port => \"9999\"\r\n }\r\n }\r\n output { stdout { debug => \"true\" }}\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Create a python package~\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n"} \ No newline at end of file From ef3f58e67933f566b672a6432e3afc97e9e635d7 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Dec 2012 09:29:57 -0800 Subject: [PATCH 08/14] Create gh-pages branch via GitHub --- index.html | 87 +++++++++++++++++++++++++++++++++++------------------ params.json | 2 +- 2 files changed, 59 insertions(+), 30 deletions(-) diff --git a/index.html b/index.html index 5b2adef2..8283c519 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@

    Requirements

    From PyPI::

    -
    pip install beaver==3
    +
    pip install beaver==10
     

    Usage

    @@ -81,6 +81,8 @@

    Background

    Events are sent in logstash's json_event format. Options can also be set as environment variables.

    +

    NOTE: the redis transport uses a namespace of logstash:beaver by default. You will need to update your logstash indexer to match this.

    +

    Examples

    Example 1: Listen to all files in the default path of /var/log on standard out as json::

    @@ -100,39 +102,43 @@

    Examples

    Example 4: Sending logs from /var/log files to a redis list::

    -
    REDIS_URL="redis://localhost:6379/0" beaver -t redis
    +
    REDIS_URL='redis://localhost:6379/0' beaver -t redis
     

    Example 5: Use environment variables to send logs from /var/log files to a redis list::

    -
    REDIS_URL="redis://localhost:6379/0" BEAVER_PATH="/var/log" BEAVER_TRANSPORT=redis beaver
    +
    REDIS_URL='redis://localhost:6379/0' BEAVER_PATH='/var/log' BEAVER_TRANSPORT=redis beaver
     

    Example 6: Zeromq listening on port 5556 (all interfaces)::

    -
    ZEROMQ_ADDRESS="tcp://*:5556" beaver -m bind -t zmq
    +
    ZEROMQ_ADDRESS='tcp://*:5556' beaver -m bind -t zmq
     
     # logstash config:
    -input { zeromq {
    +input {
    +  zeromq {
         type => 'shipper-input'
         mode => 'client'
         topology => 'pushpull'
         address => 'tcp://shipperhost:5556'
    -  } }
    +  }
    +}
     output { stdout { debug => true } }
     

    Example 7: Zeromq connecting to remote port 5556 on indexer::

    -
    ZEROMQ_ADDRESS="tcp://indexer:5556" beaver -m connect -t zmq
    +
    ZEROMQ_ADDRESS='tcp://indexer:5556' beaver -m connect -t zmq
     
     # logstash config:
    -input { zeromq {
    +input {
    +  zeromq {
         type => 'shipper-input'
         mode => 'server'
         topology => 'pushpull'
         address => 'tcp://*:5556'
    -  }}
    +  }
    +}
     output { stdout { debug => true } }
     
    @@ -145,13 +151,15 @@

    Examples

    REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis # logstash indexer config: -input { redis { - host => 'redis-internal' # this is in dns for work +input { + redis { + host => 'redis-internal' data_type => 'list' key => 'app:unmappable' type => 'app:unmappable' -}} -output { stdout { debug => "true" }} + } +} +output { stdout { debug => true } }

    As you can see, beaver is pretty flexible as to how you can use/abuse it in production.

    @@ -159,20 +167,21 @@

    Examples

    Example 9: RabbitMQ connecting to defaults on remote broker::

    # From the commandline
    -RABBITMQ_HOST="10.0.0.1" beaver -t rabbitmq
    +RABBITMQ_HOST='10.0.0.1' beaver -t rabbitmq
     
     # logstash config:
     input { amqp {
    -    name => "logstash-queue"
    -    type => "direct"
    -    host => "10.0.0.1"
    -    exchange => "logstash-exchange"
    -    key => "logstash-key"
    +    name => 'logstash-queue'
    +    type => 'direct'
    +    host => '10.0.0.1'
    +    exchange => 'logstash-exchange'
    +    key => 'logstash-key'
         exclusive => false
         durable => false
         auto_delete => false
    -  }}
    -output { stdout { debug => "true" }}
    +  }
    +}
    +output { stdout { debug => true } }
     

    Example 10: Read config from config.ini and put to stdout::

    @@ -189,22 +198,26 @@

    Examples

    [/var/log/*log] type: syslog tags: sys + +[/var/log/{secure,messages}.log] +type: syslog +tags: sys

    Example 11: UDP transport::

    # From the commandline
    -UDP_HOST="127.0.0.1" UDP_PORT="9999" beaver -t udp
    +UDP_HOST='127.0.0.1' UDP_PORT='9999' beaver -t udp
     
     # logstash config:
     input {
       udp {
    -    type => "shipper-input"
    -    host => "127.0.0.1"
    -    port => "9999"
    +    type => 'shipper-input'
    +    host => '127.0.0.1'
    +    port => '9999'
       }
     }
    -output { stdout { debug => "true" }}
    +output { stdout { debug => true } }
     

    Todo

    @@ -213,9 +226,25 @@

    Todo

  • Use python threading + subprocess in order to support usage of yield across all operating systems
  • Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution
  • More transports
  • -
  • ~Create a python package~
  • -
  • ~Ability to specify files, tags, and other metadata within a configuration file~
  • -

Credits

+
  • ~Ability to specify files, tags, and other metadata within a configuration file~
  • +

    Caveats

    + +

    When using copytruncate style log rotation, two race conditions can occur:

    + +
      +
    1. Any log data written prior to truncation which beaver has not yet +read and processed is lost. Nothing we can do about that.

    2. +
    3. +

      Should the file be truncated, rewritten, and end up being larger than +the original file during the sleep interval, beaver won't detect +this. After some experimentation, this behavior also exists in GNU +tail, so I'm going to call this a "don't do that then" bug :)

      + +

      Additionally, the files beaver will most likely be called upon to +watch which may be truncated are generally going to be large enough +and slow-filling enough that this won't crop up in the wild.

      +
    4. +

    Credits

    Based on work from Giampaolo and Lusis::

    diff --git a/params.json b/params.json index 812f034d..ac2d7334 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","tagline":"python daemon that munches on logs and sends their contents to logstash","google":"","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==3\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d DEBUG, --debug DEBUG\r\n enable debug mode\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL=\"redis://localhost:6379/0\" BEAVER_PATH=\"/var/log\" BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://*:5556\" beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n } }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS=\"tcp://indexer:5556\" beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input { zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }}\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input { redis {\r\n host => 'redis-internal' # this is in dns for work\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST=\"10.0.0.1\" beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => \"logstash-queue\"\r\n type => \"direct\"\r\n host => \"10.0.0.1\"\r\n exchange => \"logstash-exchange\"\r\n key => \"logstash-key\"\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }}\r\n output { stdout { debug => \"true\" }}\r\n\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\nExample 11: UDP transport::\r\n\r\n # From the commandline\r\n UDP_HOST=\"127.0.0.1\" UDP_PORT=\"9999\" beaver -t udp\r\n\r\n # logstash config:\r\n input {\r\n udp {\r\n type => \"shipper-input\"\r\n host => \"127.0.0.1\"\r\n port => \"9999\"\r\n }\r\n }\r\n output { stdout { debug => \"true\" }}\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Create a python package~\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n"} \ No newline at end of file +{"body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==10\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d DEBUG, --debug DEBUG\r\n enable debug mode\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL='redis://localhost:6379/0' beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL='redis://localhost:6379/0' BEAVER_PATH='/var/log' BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS='tcp://*:5556' beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS='tcp://indexer:5556' beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST='10.0.0.1' beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\nExample 11: UDP transport::\r\n\r\n # From the commandline\r\n UDP_HOST='127.0.0.1' UDP_PORT='9999' beaver -t udp\r\n\r\n # logstash config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","name":"Beaver","tagline":"python daemon that munches on logs and sends their contents to logstash","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file From 886c6d1a139deb9122f06e3272cae897aa445eda Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Dec 2012 09:39:15 -0800 Subject: [PATCH 09/14] Create gh-pages branch via GitHub --- index.html | 6 ++++-- params.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 8283c519..cab48dc9 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@

    Requirements

    From PyPI::

    -
    pip install beaver==10
    +
    pip install beaver==11
     

    Usage

    @@ -55,7 +55,7 @@

    Usage

    usage::

    beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]
    -          [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG]
    +          [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG] [--fqdn]
     

    optional arguments::

    @@ -73,6 +73,8 @@

    Usage

    ini config file path -d DEBUG, --debug DEBUG enable debug mode +--fqdn + use the machine's FQDN for source_host

    Background

    diff --git a/params.json b/params.json index ac2d7334..4bc97395 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==10\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d DEBUG, --debug DEBUG\r\n enable debug mode\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL='redis://localhost:6379/0' beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL='redis://localhost:6379/0' BEAVER_PATH='/var/log' BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS='tcp://*:5556' beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS='tcp://indexer:5556' beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST='10.0.0.1' beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\nExample 11: UDP transport::\r\n\r\n # From the commandline\r\n UDP_HOST='127.0.0.1' UDP_PORT='9999' beaver -t udp\r\n\r\n # logstash config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","name":"Beaver","tagline":"python daemon that munches on logs and sends their contents to logstash","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file +{"google":"","tagline":"python daemon that munches on logs and sends their contents to logstash","note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==11\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d DEBUG, --debug DEBUG\r\n enable debug mode\r\n --fqdn\r\n use the machine's FQDN for source_host\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL='redis://localhost:6379/0' beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL='redis://localhost:6379/0' BEAVER_PATH='/var/log' BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS='tcp://*:5556' beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS='tcp://indexer:5556' beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST='10.0.0.1' beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\nExample 11: UDP transport::\r\n\r\n # From the commandline\r\n UDP_HOST='127.0.0.1' UDP_PORT='9999' beaver -t udp\r\n\r\n # logstash config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n"} \ No newline at end of file From 849fd1421b625fd53db024b0f8ef379d49cf8ebc Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 18 Dec 2012 14:15:37 -0800 Subject: [PATCH 10/14] Create gh-pages branch via GitHub --- index.html | 151 ++++++++++++++++++++++++++++++++++++++++------------ params.json | 2 +- 2 files changed, 118 insertions(+), 35 deletions(-) diff --git a/index.html b/index.html index cab48dc9..81a75c53 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@

    Requirements

    From PyPI::

    -
    pip install beaver==11
    +
    pip install beaver==14
     

    Usage

    @@ -61,20 +61,22 @@

    Usage

    optional arguments::

    -h, --help            show this help message and exit
    +-c CONFIG, --configfile CONFIG
    +                      ini config file path
    +-d, --debug           enable debug mode
    +-f FILES [FILES ...], --files FILES [FILES ...]
    +                      space-separated filelist to watch, can include globs
    +                      (*.log). Overrides --path argument
    +--format {json,msgpack,string}
    +                      format to use when sending to transport
    +--hostname HOSTNAME   manual hostname override for source_host
     -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, 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
    --d DEBUG, --debug DEBUG
    -                    enable debug mode
    ---fqdn
    -                    use the machine's FQDN for source_host
    +-t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp}
    +                      log transport method
    +-v, --version         output version and quit
    +--fqdn                use the machine's FQDN
     

    Background

    @@ -85,7 +87,54 @@

    Background

    NOTE: the redis transport uses a namespace of logstash:beaver by default. You will need to update your logstash indexer to match this.

    -

    Examples

    +

    Configuration File Options

    + +

    Beaver can optionally get data from a configfile using the -c flag. This file is in ini format. Global configuration will be under the beaver stanza. The following are global beaver configuration keys with their respective meanings:

    + +
      +
    • rabbitmq_host: Defaults localhost. Host for RabbitMQ.
    • +
    • rabbitmq_port: Defaults 5672. Port for RabbitMQ.
    • +
    • rabbitmq_vhost: Default / +
    • +
    • rabbitmq_username: Default guest +
    • +
    • rabbitmq_password: Default guest +
    • +
    • rabbitmq_queue: Default logstash-queue.
    • +
    • rabbitmq_exchange: Default direct.
    • +
    • rabbitmq_exchange_durable: Default 0.
    • +
    • rabbitmq_key: Default logstash-key.
    • +
    • rabbitmq_exchange: Default logstash-exchange.
    • +
    • redis_url: Default redis://localhost:6379/0. Redis URL
    • +
    • redis_namespace: Default logstash:beaver. Redis key namespace
    • +
    • udp_host: Default 127.0.0.1. UDP Host
    • +
    • udp_port: Default 9999. UDP Port
    • +
    • zeromq_address: Default tcp://localhost:2120. Zeromq URL
    • +
    • zeromq_bind: Default bind. Whether to bind to zeromq host or simply connect
    • +

    The following are used for instances when a TransportException is thrown - Transport dependent

    + +
      +
    • respawn_delay: Default 3. Initial respawn delay for exponential backoff
    • +
    • max_failure: Default 7. Max failures before exponential backoff terminates
    • +

    The following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.

    + +
      +
    • ssh_key_file: Default None. Full path to id_rsa key file
    • +
    • ssh_tunnel: Default None. SSH Tunnel in the format user@host:port +
    • +
    • ssh_tunnel_port: Default None. Local port for SSH Tunnel
    • +
    • ssh_remote_host: Default None. Remote host to connect to within SSH Tunnel
    • +
    • ssh_remote_port: Default None. Remote port to connect to within SSH Tunnel
    • +

    The following can also be passed via argparse. Argparse will override all options in the configfile, when specified.

    + +
      +
    • format: Default json. Options [ json, msgpack, string ]. Format to use when sending to transport
    • +
    • files: Default files. Space-separated list of files to tail.
    • +
    • path: Default /var/log. Path glob to tail.
    • +
    • transport: Default stdout. Transport to use when log changes are detected
    • +
    • fqdn: Default False. Whether to use the machine's FQDN in transport output
    • +
    • hostname: Default None. Manually specified hostname
    • +

    Examples

    Example 1: Listen to all files in the default path of /var/log on standard out as json::

    @@ -94,29 +143,41 @@

    Examples

    Example 2: Listen to all files in the default path of /var/log on standard out with msgpack::

    -
    BEAVER_FORMAT='msgpack' beaver
    +
    beaver --format msgpack
     

    Example 3: Listen to all files in the default path of /var/log on standard out as a string::

    -
    BEAVER_FORMAT='string' beaver
    +
    beaver --format string
     

    Example 4: Sending logs from /var/log files to a redis list::

    -
    REDIS_URL='redis://localhost:6379/0' beaver -t redis
    +
    # /etc/beaver.conf
    +[beaver]
    +redis_url: redis://localhost:6379/0
    +
    +# From the commandline
    +beaver  -c /etc/beaver.conf -t redis
     

    Example 5: Use environment variables to send logs from /var/log files to a redis list::

    -
    REDIS_URL='redis://localhost:6379/0' BEAVER_PATH='/var/log' BEAVER_TRANSPORT=redis beaver
    +
    # /etc/beaver.conf
    +[beaver]
    +redis_url: redis://localhost:6379/0
    +
    +# From the commandline
    +beaver  -c /etc/beaver.conf -p '/var/log' -t redis
     

    Example 6: Zeromq listening on port 5556 (all interfaces)::

    -
    ZEROMQ_ADDRESS='tcp://*:5556' beaver -m bind -t zmq
    +
    # /etc/beaver.conf
    +[beaver]
    +zeromq_address: tcp://*:5556
     
    -# logstash config:
    +# logstash indexer config:
     input {
       zeromq {
         type => 'shipper-input'
    @@ -126,13 +187,18 @@ 

    Examples

    } } output { stdout { debug => true } } + +# From the commandline +beaver -c /etc/beaver.conf -m bind -t zmq

    Example 7: Zeromq connecting to remote port 5556 on indexer::

    -
    ZEROMQ_ADDRESS='tcp://indexer:5556' beaver -m connect -t zmq
    +
    # /etc/beaver.conf
    +[beaver]
    +zeromq_address: tcp://indexer:5556
     
    -# logstash config:
    +# logstash indexer config:
     input {
       zeromq {
         type => 'shipper-input'
    @@ -142,6 +208,9 @@ 

    Examples

    } } output { stdout { debug => true } } + +# on the commandline +beaver -c /etc/beaver.conf -m connect -t zmq

    Example 8: Real-world usage of Redis as a transport::

    @@ -149,8 +218,10 @@

    Examples

    # in /etc/hosts
     192.168.0.10 redis-internal
     
    -# From the commandline
    -REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis
    +# /etc/beaver.conf
    +[beaver]
    +redis_url: redis://redis-internal:6379/0
    +redis_namespace: app:unmappable
     
     # logstash indexer config:
     input {
    @@ -162,16 +233,20 @@ 

    Examples

    } } output { stdout { debug => true } } + +# From the commandline +beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis

    As you can see, beaver is pretty flexible as to how you can use/abuse it in production.

    Example 9: RabbitMQ connecting to defaults on remote broker::

    -
    # From the commandline
    -RABBITMQ_HOST='10.0.0.1' beaver -t rabbitmq
    +
    # /etc/beaver.conf
    +[beaver]
    +rabbitmq_host: 10.0.0.1
     
    -# logstash config:
    +# logstash indexer config:
     input { amqp {
         name => 'logstash-queue'
         type => 'direct'
    @@ -184,14 +259,14 @@ 

    Examples

    } } output { stdout { debug => true } } + +# From the commandline +beaver -c /etc/beaver.conf -t rabbitmq

    Example 10: Read config from config.ini and put to stdout::

    -
    # From the commandline
    -beaver -c config.ini -t stdout
    -
    -# config.ini content:
    +
    # /etc/beaver.conf:
     [/tmp/somefile]
     type: mytype
     tags: tag1,tag2
    @@ -204,14 +279,19 @@ 

    Examples

    [/var/log/{secure,messages}.log] type: syslog tags: sys + +# From the commandline +beaver -c /etc/beaver.conf -t stdout

    Example 11: UDP transport::

    -
    # From the commandline
    -UDP_HOST='127.0.0.1' UDP_PORT='9999' beaver -t udp
    +
    # /etc/beaver.conf
    +[beaver]
    +udp_host: 127.0.0.1
    +udp_port: 9999
     
    -# logstash config:
    +# logstash indexer config:
     input {
       udp {
         type => 'shipper-input'
    @@ -220,6 +300,9 @@ 

    Examples

    } } output { stdout { debug => true } } + +# From the commandline +beaver -c /etc/beaver.conf -t udp

    Todo

    diff --git a/params.json b/params.json index 4bc97395..e8a1c111 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"google":"","tagline":"python daemon that munches on logs and sends their contents to logstash","note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==11\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -t {rabbitmq,redis,stdout,zmq}, --transport {rabbitmq,redis,stdout,zmq}\r\n log transport method\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d DEBUG, --debug DEBUG\r\n enable debug mode\r\n --fqdn\r\n use the machine's FQDN for source_host\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this.\r\n\r\nExamples\r\n--------\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n BEAVER_FORMAT='msgpack' beaver\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n BEAVER_FORMAT='string' beaver\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n REDIS_URL='redis://localhost:6379/0' beaver -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n REDIS_URL='redis://localhost:6379/0' BEAVER_PATH='/var/log' BEAVER_TRANSPORT=redis beaver\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n ZEROMQ_ADDRESS='tcp://*:5556' beaver -m bind -t zmq\r\n\r\n # logstash config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n ZEROMQ_ADDRESS='tcp://indexer:5556' beaver -m connect -t zmq\r\n\r\n # logstash config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # From the commandline\r\n REDIS_NAMESPACE='app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /var/log/unmappable.log -t redis\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # From the commandline\r\n RABBITMQ_HOST='10.0.0.1' beaver -t rabbitmq\r\n\r\n # logstash config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # From the commandline\r\n beaver -c config.ini -t stdout\r\n\r\n # config.ini content:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\nExample 11: UDP transport::\r\n\r\n # From the commandline\r\n UDP_HOST='127.0.0.1' UDP_PORT='9999' beaver -t udp\r\n\r\n # logstash config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n"} \ No newline at end of file +{"body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==14\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d, --debug enable debug mode\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n --format {json,msgpack,string}\r\n format to use when sending to transport\r\n --hostname HOSTNAME manual hostname override for source_host\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp}\r\n log transport method\r\n -v, --version output version and quit\r\n --fqdn use the machine's FQDN\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this.\r\n\r\nConfiguration File Options\r\n--------------------------\r\n\r\nBeaver can optionally get data from a ``configfile`` using the ``-c`` flag. This file is in ``ini`` format. Global configuration will be under the ``beaver`` stanza. The following are global beaver configuration keys with their respective meanings:\r\n\r\n* rabbitmq_host: Defaults ``localhost``. Host for RabbitMQ.\r\n* rabbitmq_port: Defaults ``5672``. Port for RabbitMQ.\r\n* rabbitmq_vhost: Default ``/``\r\n* rabbitmq_username: Default ``guest``\r\n* rabbitmq_password: Default ``guest``\r\n* rabbitmq_queue: Default ``logstash-queue``.\r\n* rabbitmq_exchange: Default ``direct``.\r\n* rabbitmq_exchange_durable: Default ``0``.\r\n* rabbitmq_key: Default ``logstash-key``.\r\n* rabbitmq_exchange: Default ``logstash-exchange``.\r\n* redis_url: Default ``redis://localhost:6379/0``. Redis URL\r\n* redis_namespace: Default ``logstash:beaver``. Redis key namespace\r\n* udp_host: Default ``127.0.0.1``. UDP Host\r\n* udp_port: Default ``9999``. UDP Port\r\n* zeromq_address: Default ``tcp://localhost:2120``. Zeromq URL\r\n* zeromq_bind: Default ``bind``. Whether to bind to zeromq host or simply connect\r\n\r\nThe following are used for instances when a TransportException is thrown - Transport dependent\r\n\r\n* respawn_delay: Default ``3``. Initial respawn delay for exponential backoff\r\n* max_failure: Default ``7``. Max failures before exponential backoff terminates\r\n\r\nThe following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.\r\n\r\n* ssh_key_file: Default ``None``. Full path to ``id_rsa`` key file\r\n* ssh_tunnel: Default ``None``. SSH Tunnel in the format ``user@host:port``\r\n* ssh_tunnel_port: Default ``None``. Local port for SSH Tunnel\r\n* ssh_remote_host: Default ``None``. Remote host to connect to within SSH Tunnel\r\n* ssh_remote_port: Default ``None``. Remote port to connect to within SSH Tunnel\r\n\r\nThe following can also be passed via argparse. Argparse will override all options in the configfile, when specified.\r\n\r\n* format: Default ``json``. Options ``[ json, msgpack, string ]``. Format to use when sending to transport\r\n* files: Default ``files``. Space-separated list of files to tail.\r\n* path: Default ``/var/log``. Path glob to tail.\r\n* transport: Default ``stdout``. Transport to use when log changes are detected\r\n* fqdn: Default ``False``. Whether to use the machine's FQDN in transport output\r\n* hostname: Default ``None``. Manually specified hostname\r\n\r\nExamples\r\n--------\r\n\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n beaver --format msgpack\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n beaver --format string\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -p '/var/log' -t redis\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://*:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -m bind -t zmq\r\n\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://indexer:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # on the commandline\r\n beaver -c /etc/beaver.conf -m connect -t zmq\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://redis-internal:6379/0\r\n redis_namespace: app:unmappable\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n rabbitmq_host: 10.0.0.1\r\n\r\n # logstash indexer config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t rabbitmq\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # /etc/beaver.conf:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t stdout\r\n\r\nExample 11: UDP transport::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n udp_host: 127.0.0.1\r\n udp_port: 9999\r\n\r\n # logstash indexer config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t udp\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","name":"Beaver","google":"","tagline":"python daemon that munches on logs and sends their contents to logstash","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file From 114596072cfaaf7d6960a772bb7999cb36e7d8bf Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 27 Dec 2012 16:39:41 -0800 Subject: [PATCH 11/14] Create gh-pages branch via GitHub --- index.html | 26 +++++++++++++++++--------- params.json | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 81a75c53..d9d03ea7 100644 --- a/index.html +++ b/index.html @@ -47,15 +47,17 @@

    Requirements

    From PyPI::

    -
    pip install beaver==14
    +
    pip install beaver==16
     

    Usage

    usage::

    -
    beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]
    -          [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG] [--fqdn]
    +
    beaver [-h] [-c CONFIG] [-d] [-D] [-f FILES [FILES ...]]
    +       [-F {json,msgpack,string}] [-H HOSTNAME] [-m {bind,connect}]
    +       [-o OUTPUT] [-p PATH] [-P PID]
    +       [-t {rabbitmq,redis,stdout,zmq,udp}] [-v] [--fqdn]
     

    optional arguments::

    @@ -64,19 +66,24 @@

    Usage

    -c CONFIG, --configfile CONFIG ini config file path -d, --debug enable debug mode +-D, --daemonize daemonize in the background -f FILES [FILES ...], --files FILES [FILES ...] space-separated filelist to watch, can include globs (*.log). Overrides --path argument ---format {json,msgpack,string} +-F {json,msgpack,string}, --format {json,msgpack,string} format to use when sending to transport ---hostname HOSTNAME manual hostname override for source_host +-H HOSTNAME, --hostname HOSTNAME + manual hostname override for source_host -m {bind,connect}, --mode {bind,connect} bind or connect mode +-o OUTPUT, --output OUTPUT + file to pipe output to (in addition to stdout) -p PATH, --path PATH path to log files +-P PID, --pid PID path to pid file -t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp} log transport method -v, --version output version and quit ---fqdn use the machine's FQDN +--fqdn use the machine's FQDN for source_host

    Background

    @@ -85,7 +92,7 @@

    Background

    Events are sent in logstash's json_event format. Options can also be set as environment variables.

    -

    NOTE: the redis transport uses a namespace of logstash:beaver by default. You will need to update your logstash indexer to match this.

    +

    NOTE: the redis transport uses a namespace of logstash:beaver by default. You will need to update your logstash indexer to match this, or you may configure beaver to do otherwise.

    Configuration File Options

    @@ -308,10 +315,11 @@

    Configuration File Options

    Todo

      +
    • More documentation
    • Use python threading + subprocess in order to support usage of yield across all operating systems
    • -
    • Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution
    • +
    • Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution
    • More transports
    • -
    • ~Ability to specify files, tags, and other metadata within a configuration file~
    • +
    • Ability to specify files, tags, and other metadata within a configuration file

    Caveats

    When using copytruncate style log rotation, two race conditions can occur:

    diff --git a/params.json b/params.json index e8a1c111..cd5db3ce 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==14\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-m {bind,connect}] [-p PATH] [-f FILES [FILES ...]]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-c CONFIG] [-d DEBUG] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d, --debug enable debug mode\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n --format {json,msgpack,string}\r\n format to use when sending to transport\r\n --hostname HOSTNAME manual hostname override for source_host\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -p PATH, --path PATH path to log files\r\n -t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp}\r\n log transport method\r\n -v, --version output version and quit\r\n --fqdn use the machine's FQDN\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this.\r\n\r\nConfiguration File Options\r\n--------------------------\r\n\r\nBeaver can optionally get data from a ``configfile`` using the ``-c`` flag. This file is in ``ini`` format. Global configuration will be under the ``beaver`` stanza. The following are global beaver configuration keys with their respective meanings:\r\n\r\n* rabbitmq_host: Defaults ``localhost``. Host for RabbitMQ.\r\n* rabbitmq_port: Defaults ``5672``. Port for RabbitMQ.\r\n* rabbitmq_vhost: Default ``/``\r\n* rabbitmq_username: Default ``guest``\r\n* rabbitmq_password: Default ``guest``\r\n* rabbitmq_queue: Default ``logstash-queue``.\r\n* rabbitmq_exchange: Default ``direct``.\r\n* rabbitmq_exchange_durable: Default ``0``.\r\n* rabbitmq_key: Default ``logstash-key``.\r\n* rabbitmq_exchange: Default ``logstash-exchange``.\r\n* redis_url: Default ``redis://localhost:6379/0``. Redis URL\r\n* redis_namespace: Default ``logstash:beaver``. Redis key namespace\r\n* udp_host: Default ``127.0.0.1``. UDP Host\r\n* udp_port: Default ``9999``. UDP Port\r\n* zeromq_address: Default ``tcp://localhost:2120``. Zeromq URL\r\n* zeromq_bind: Default ``bind``. Whether to bind to zeromq host or simply connect\r\n\r\nThe following are used for instances when a TransportException is thrown - Transport dependent\r\n\r\n* respawn_delay: Default ``3``. Initial respawn delay for exponential backoff\r\n* max_failure: Default ``7``. Max failures before exponential backoff terminates\r\n\r\nThe following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.\r\n\r\n* ssh_key_file: Default ``None``. Full path to ``id_rsa`` key file\r\n* ssh_tunnel: Default ``None``. SSH Tunnel in the format ``user@host:port``\r\n* ssh_tunnel_port: Default ``None``. Local port for SSH Tunnel\r\n* ssh_remote_host: Default ``None``. Remote host to connect to within SSH Tunnel\r\n* ssh_remote_port: Default ``None``. Remote port to connect to within SSH Tunnel\r\n\r\nThe following can also be passed via argparse. Argparse will override all options in the configfile, when specified.\r\n\r\n* format: Default ``json``. Options ``[ json, msgpack, string ]``. Format to use when sending to transport\r\n* files: Default ``files``. Space-separated list of files to tail.\r\n* path: Default ``/var/log``. Path glob to tail.\r\n* transport: Default ``stdout``. Transport to use when log changes are detected\r\n* fqdn: Default ``False``. Whether to use the machine's FQDN in transport output\r\n* hostname: Default ``None``. Manually specified hostname\r\n\r\nExamples\r\n--------\r\n\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n beaver --format msgpack\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n beaver --format string\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -p '/var/log' -t redis\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://*:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -m bind -t zmq\r\n\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://indexer:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # on the commandline\r\n beaver -c /etc/beaver.conf -m connect -t zmq\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://redis-internal:6379/0\r\n redis_namespace: app:unmappable\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n rabbitmq_host: 10.0.0.1\r\n\r\n # logstash indexer config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t rabbitmq\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # /etc/beaver.conf:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t stdout\r\n\r\nExample 11: UDP transport::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n udp_host: 127.0.0.1\r\n udp_port: 9999\r\n\r\n # logstash indexer config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t udp\r\n\r\nTodo\r\n====\r\n\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* ~Ability to specify files, tags, and other metadata within a configuration file~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","name":"Beaver","google":"","tagline":"python daemon that munches on logs and sends their contents to logstash","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file +{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==16\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-c CONFIG] [-d] [-D] [-f FILES [FILES ...]]\r\n [-F {json,msgpack,string}] [-H HOSTNAME] [-m {bind,connect}]\r\n [-o OUTPUT] [-p PATH] [-P PID]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-v] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d, --debug enable debug mode\r\n -D, --daemonize daemonize in the background\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -F {json,msgpack,string}, --format {json,msgpack,string}\r\n format to use when sending to transport\r\n -H HOSTNAME, --hostname HOSTNAME\r\n manual hostname override for source_host\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -o OUTPUT, --output OUTPUT\r\n file to pipe output to (in addition to stdout)\r\n -p PATH, --path PATH path to log files\r\n -P PID, --pid PID path to pid file\r\n -t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp}\r\n log transport method\r\n -v, --version output version and quit\r\n --fqdn use the machine's FQDN for source_host\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this, or you may configure beaver to do otherwise.\r\n\r\nConfiguration File Options\r\n--------------------------\r\n\r\nBeaver can optionally get data from a ``configfile`` using the ``-c`` flag. This file is in ``ini`` format. Global configuration will be under the ``beaver`` stanza. The following are global beaver configuration keys with their respective meanings:\r\n\r\n* rabbitmq_host: Defaults ``localhost``. Host for RabbitMQ.\r\n* rabbitmq_port: Defaults ``5672``. Port for RabbitMQ.\r\n* rabbitmq_vhost: Default ``/``\r\n* rabbitmq_username: Default ``guest``\r\n* rabbitmq_password: Default ``guest``\r\n* rabbitmq_queue: Default ``logstash-queue``.\r\n* rabbitmq_exchange: Default ``direct``.\r\n* rabbitmq_exchange_durable: Default ``0``.\r\n* rabbitmq_key: Default ``logstash-key``.\r\n* rabbitmq_exchange: Default ``logstash-exchange``.\r\n* redis_url: Default ``redis://localhost:6379/0``. Redis URL\r\n* redis_namespace: Default ``logstash:beaver``. Redis key namespace\r\n* udp_host: Default ``127.0.0.1``. UDP Host\r\n* udp_port: Default ``9999``. UDP Port\r\n* zeromq_address: Default ``tcp://localhost:2120``. Zeromq URL\r\n* zeromq_bind: Default ``bind``. Whether to bind to zeromq host or simply connect\r\n\r\nThe following are used for instances when a TransportException is thrown - Transport dependent\r\n\r\n* respawn_delay: Default ``3``. Initial respawn delay for exponential backoff\r\n* max_failure: Default ``7``. Max failures before exponential backoff terminates\r\n\r\nThe following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.\r\n\r\n* ssh_key_file: Default ``None``. Full path to ``id_rsa`` key file\r\n* ssh_tunnel: Default ``None``. SSH Tunnel in the format ``user@host:port``\r\n* ssh_tunnel_port: Default ``None``. Local port for SSH Tunnel\r\n* ssh_remote_host: Default ``None``. Remote host to connect to within SSH Tunnel\r\n* ssh_remote_port: Default ``None``. Remote port to connect to within SSH Tunnel\r\n\r\nThe following can also be passed via argparse. Argparse will override all options in the configfile, when specified.\r\n\r\n* format: Default ``json``. Options ``[ json, msgpack, string ]``. Format to use when sending to transport\r\n* files: Default ``files``. Space-separated list of files to tail.\r\n* path: Default ``/var/log``. Path glob to tail.\r\n* transport: Default ``stdout``. Transport to use when log changes are detected\r\n* fqdn: Default ``False``. Whether to use the machine's FQDN in transport output\r\n* hostname: Default ``None``. Manually specified hostname\r\n\r\nExamples\r\n--------\r\n\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n beaver --format msgpack\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n beaver --format string\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -p '/var/log' -t redis\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://*:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -m bind -t zmq\r\n\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://indexer:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # on the commandline\r\n beaver -c /etc/beaver.conf -m connect -t zmq\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://redis-internal:6379/0\r\n redis_namespace: app:unmappable\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n rabbitmq_host: 10.0.0.1\r\n\r\n # logstash indexer config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t rabbitmq\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # /etc/beaver.conf:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t stdout\r\n\r\nExample 11: UDP transport::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n udp_host: 127.0.0.1\r\n udp_port: 9999\r\n\r\n # logstash indexer config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t udp\r\n\r\nTodo\r\n====\r\n\r\n* More documentation\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* ~~Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution~~\r\n* More transports\r\n* ~~Ability to specify files, tags, and other metadata within a configuration file~~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","tagline":"python daemon that munches on logs and sends their contents to logstash","google":""} \ No newline at end of file From 3b89f2f45c1e1bba923681f0059c4ce30c4969c0 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 3 Jan 2013 13:19:09 -0800 Subject: [PATCH 12/14] Create gh-pages branch via GitHub --- index.html | 4 ++-- params.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index d9d03ea7..39d71447 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@

    python daemon that munches on logs and sends their contents to logstash

    Requirements

      -
    • Python 2.7 (untested on other versions)
    • +
    • Python 2.6+
    • Optional zeromq support: install libzmq (brew install zmq or apt-get install libzmq-dev) and pyzmq (pip install pyzmq==2.1.11)

    Installation

    @@ -47,7 +47,7 @@

    Requirements

    From PyPI::

    -
    pip install beaver==16
    +
    pip install beaver==20
     

    Usage

    diff --git a/params.json b/params.json index cd5db3ce..ac758864 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","body":"Requirements\r\n============\r\n\r\n* Python 2.7 (untested on other versions)\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==16\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-c CONFIG] [-d] [-D] [-f FILES [FILES ...]]\r\n [-F {json,msgpack,string}] [-H HOSTNAME] [-m {bind,connect}]\r\n [-o OUTPUT] [-p PATH] [-P PID]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-v] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d, --debug enable debug mode\r\n -D, --daemonize daemonize in the background\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -F {json,msgpack,string}, --format {json,msgpack,string}\r\n format to use when sending to transport\r\n -H HOSTNAME, --hostname HOSTNAME\r\n manual hostname override for source_host\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -o OUTPUT, --output OUTPUT\r\n file to pipe output to (in addition to stdout)\r\n -p PATH, --path PATH path to log files\r\n -P PID, --pid PID path to pid file\r\n -t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp}\r\n log transport method\r\n -v, --version output version and quit\r\n --fqdn use the machine's FQDN for source_host\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this, or you may configure beaver to do otherwise.\r\n\r\nConfiguration File Options\r\n--------------------------\r\n\r\nBeaver can optionally get data from a ``configfile`` using the ``-c`` flag. This file is in ``ini`` format. Global configuration will be under the ``beaver`` stanza. The following are global beaver configuration keys with their respective meanings:\r\n\r\n* rabbitmq_host: Defaults ``localhost``. Host for RabbitMQ.\r\n* rabbitmq_port: Defaults ``5672``. Port for RabbitMQ.\r\n* rabbitmq_vhost: Default ``/``\r\n* rabbitmq_username: Default ``guest``\r\n* rabbitmq_password: Default ``guest``\r\n* rabbitmq_queue: Default ``logstash-queue``.\r\n* rabbitmq_exchange: Default ``direct``.\r\n* rabbitmq_exchange_durable: Default ``0``.\r\n* rabbitmq_key: Default ``logstash-key``.\r\n* rabbitmq_exchange: Default ``logstash-exchange``.\r\n* redis_url: Default ``redis://localhost:6379/0``. Redis URL\r\n* redis_namespace: Default ``logstash:beaver``. Redis key namespace\r\n* udp_host: Default ``127.0.0.1``. UDP Host\r\n* udp_port: Default ``9999``. UDP Port\r\n* zeromq_address: Default ``tcp://localhost:2120``. Zeromq URL\r\n* zeromq_bind: Default ``bind``. Whether to bind to zeromq host or simply connect\r\n\r\nThe following are used for instances when a TransportException is thrown - Transport dependent\r\n\r\n* respawn_delay: Default ``3``. Initial respawn delay for exponential backoff\r\n* max_failure: Default ``7``. Max failures before exponential backoff terminates\r\n\r\nThe following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.\r\n\r\n* ssh_key_file: Default ``None``. Full path to ``id_rsa`` key file\r\n* ssh_tunnel: Default ``None``. SSH Tunnel in the format ``user@host:port``\r\n* ssh_tunnel_port: Default ``None``. Local port for SSH Tunnel\r\n* ssh_remote_host: Default ``None``. Remote host to connect to within SSH Tunnel\r\n* ssh_remote_port: Default ``None``. Remote port to connect to within SSH Tunnel\r\n\r\nThe following can also be passed via argparse. Argparse will override all options in the configfile, when specified.\r\n\r\n* format: Default ``json``. Options ``[ json, msgpack, string ]``. Format to use when sending to transport\r\n* files: Default ``files``. Space-separated list of files to tail.\r\n* path: Default ``/var/log``. Path glob to tail.\r\n* transport: Default ``stdout``. Transport to use when log changes are detected\r\n* fqdn: Default ``False``. Whether to use the machine's FQDN in transport output\r\n* hostname: Default ``None``. Manually specified hostname\r\n\r\nExamples\r\n--------\r\n\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n beaver --format msgpack\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n beaver --format string\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -p '/var/log' -t redis\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://*:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -m bind -t zmq\r\n\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://indexer:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # on the commandline\r\n beaver -c /etc/beaver.conf -m connect -t zmq\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://redis-internal:6379/0\r\n redis_namespace: app:unmappable\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n rabbitmq_host: 10.0.0.1\r\n\r\n # logstash indexer config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t rabbitmq\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # /etc/beaver.conf:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t stdout\r\n\r\nExample 11: UDP transport::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n udp_host: 127.0.0.1\r\n udp_port: 9999\r\n\r\n # logstash indexer config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t udp\r\n\r\nTodo\r\n====\r\n\r\n* More documentation\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* ~~Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution~~\r\n* More transports\r\n* ~~Ability to specify files, tags, and other metadata within a configuration file~~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","tagline":"python daemon that munches on logs and sends their contents to logstash","google":""} \ No newline at end of file +{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","google":"","tagline":"python daemon that munches on logs and sends their contents to logstash","body":"Requirements\r\n============\r\n\r\n* Python 2.6+\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==20\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-c CONFIG] [-d] [-D] [-f FILES [FILES ...]]\r\n [-F {json,msgpack,string}] [-H HOSTNAME] [-m {bind,connect}]\r\n [-o OUTPUT] [-p PATH] [-P PID]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-v] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d, --debug enable debug mode\r\n -D, --daemonize daemonize in the background\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -F {json,msgpack,string}, --format {json,msgpack,string}\r\n format to use when sending to transport\r\n -H HOSTNAME, --hostname HOSTNAME\r\n manual hostname override for source_host\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -o OUTPUT, --output OUTPUT\r\n file to pipe output to (in addition to stdout)\r\n -p PATH, --path PATH path to log files\r\n -P PID, --pid PID path to pid file\r\n -t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp}\r\n log transport method\r\n -v, --version output version and quit\r\n --fqdn use the machine's FQDN for source_host\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this, or you may configure beaver to do otherwise.\r\n\r\nConfiguration File Options\r\n--------------------------\r\n\r\nBeaver can optionally get data from a ``configfile`` using the ``-c`` flag. This file is in ``ini`` format. Global configuration will be under the ``beaver`` stanza. The following are global beaver configuration keys with their respective meanings:\r\n\r\n* rabbitmq_host: Defaults ``localhost``. Host for RabbitMQ.\r\n* rabbitmq_port: Defaults ``5672``. Port for RabbitMQ.\r\n* rabbitmq_vhost: Default ``/``\r\n* rabbitmq_username: Default ``guest``\r\n* rabbitmq_password: Default ``guest``\r\n* rabbitmq_queue: Default ``logstash-queue``.\r\n* rabbitmq_exchange: Default ``direct``.\r\n* rabbitmq_exchange_durable: Default ``0``.\r\n* rabbitmq_key: Default ``logstash-key``.\r\n* rabbitmq_exchange: Default ``logstash-exchange``.\r\n* redis_url: Default ``redis://localhost:6379/0``. Redis URL\r\n* redis_namespace: Default ``logstash:beaver``. Redis key namespace\r\n* udp_host: Default ``127.0.0.1``. UDP Host\r\n* udp_port: Default ``9999``. UDP Port\r\n* zeromq_address: Default ``tcp://localhost:2120``. Zeromq URL\r\n* zeromq_bind: Default ``bind``. Whether to bind to zeromq host or simply connect\r\n\r\nThe following are used for instances when a TransportException is thrown - Transport dependent\r\n\r\n* respawn_delay: Default ``3``. Initial respawn delay for exponential backoff\r\n* max_failure: Default ``7``. Max failures before exponential backoff terminates\r\n\r\nThe following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.\r\n\r\n* ssh_key_file: Default ``None``. Full path to ``id_rsa`` key file\r\n* ssh_tunnel: Default ``None``. SSH Tunnel in the format ``user@host:port``\r\n* ssh_tunnel_port: Default ``None``. Local port for SSH Tunnel\r\n* ssh_remote_host: Default ``None``. Remote host to connect to within SSH Tunnel\r\n* ssh_remote_port: Default ``None``. Remote port to connect to within SSH Tunnel\r\n\r\nThe following can also be passed via argparse. Argparse will override all options in the configfile, when specified.\r\n\r\n* format: Default ``json``. Options ``[ json, msgpack, string ]``. Format to use when sending to transport\r\n* files: Default ``files``. Space-separated list of files to tail.\r\n* path: Default ``/var/log``. Path glob to tail.\r\n* transport: Default ``stdout``. Transport to use when log changes are detected\r\n* fqdn: Default ``False``. Whether to use the machine's FQDN in transport output\r\n* hostname: Default ``None``. Manually specified hostname\r\n\r\nExamples\r\n--------\r\n\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n beaver --format msgpack\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n beaver --format string\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -p '/var/log' -t redis\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://*:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -m bind -t zmq\r\n\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://indexer:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # on the commandline\r\n beaver -c /etc/beaver.conf -m connect -t zmq\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://redis-internal:6379/0\r\n redis_namespace: app:unmappable\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n rabbitmq_host: 10.0.0.1\r\n\r\n # logstash indexer config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t rabbitmq\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # /etc/beaver.conf:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t stdout\r\n\r\nExample 11: UDP transport::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n udp_host: 127.0.0.1\r\n udp_port: 9999\r\n\r\n # logstash indexer config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t udp\r\n\r\nTodo\r\n====\r\n\r\n* More documentation\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* ~~Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution~~\r\n* More transports\r\n* ~~Ability to specify files, tags, and other metadata within a configuration file~~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis"} \ No newline at end of file From 2d44ea99f715f87a0500976e622d3badd8da45a5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 3 Jan 2013 18:58:37 -0800 Subject: [PATCH 13/14] Create gh-pages branch via GitHub --- index.html | 2 +- params.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 39d71447..295040ca 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@

    Requirements

    From PyPI::

    -
    pip install beaver==20
    +
    pip install beaver==21
     

    Usage

    diff --git a/params.json b/params.json index ac758864..d6d6666d 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","google":"","tagline":"python daemon that munches on logs and sends their contents to logstash","body":"Requirements\r\n============\r\n\r\n* Python 2.6+\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==20\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-c CONFIG] [-d] [-D] [-f FILES [FILES ...]]\r\n [-F {json,msgpack,string}] [-H HOSTNAME] [-m {bind,connect}]\r\n [-o OUTPUT] [-p PATH] [-P PID]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-v] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d, --debug enable debug mode\r\n -D, --daemonize daemonize in the background\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -F {json,msgpack,string}, --format {json,msgpack,string}\r\n format to use when sending to transport\r\n -H HOSTNAME, --hostname HOSTNAME\r\n manual hostname override for source_host\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -o OUTPUT, --output OUTPUT\r\n file to pipe output to (in addition to stdout)\r\n -p PATH, --path PATH path to log files\r\n -P PID, --pid PID path to pid file\r\n -t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp}\r\n log transport method\r\n -v, --version output version and quit\r\n --fqdn use the machine's FQDN for source_host\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this, or you may configure beaver to do otherwise.\r\n\r\nConfiguration File Options\r\n--------------------------\r\n\r\nBeaver can optionally get data from a ``configfile`` using the ``-c`` flag. This file is in ``ini`` format. Global configuration will be under the ``beaver`` stanza. The following are global beaver configuration keys with their respective meanings:\r\n\r\n* rabbitmq_host: Defaults ``localhost``. Host for RabbitMQ.\r\n* rabbitmq_port: Defaults ``5672``. Port for RabbitMQ.\r\n* rabbitmq_vhost: Default ``/``\r\n* rabbitmq_username: Default ``guest``\r\n* rabbitmq_password: Default ``guest``\r\n* rabbitmq_queue: Default ``logstash-queue``.\r\n* rabbitmq_exchange: Default ``direct``.\r\n* rabbitmq_exchange_durable: Default ``0``.\r\n* rabbitmq_key: Default ``logstash-key``.\r\n* rabbitmq_exchange: Default ``logstash-exchange``.\r\n* redis_url: Default ``redis://localhost:6379/0``. Redis URL\r\n* redis_namespace: Default ``logstash:beaver``. Redis key namespace\r\n* udp_host: Default ``127.0.0.1``. UDP Host\r\n* udp_port: Default ``9999``. UDP Port\r\n* zeromq_address: Default ``tcp://localhost:2120``. Zeromq URL\r\n* zeromq_bind: Default ``bind``. Whether to bind to zeromq host or simply connect\r\n\r\nThe following are used for instances when a TransportException is thrown - Transport dependent\r\n\r\n* respawn_delay: Default ``3``. Initial respawn delay for exponential backoff\r\n* max_failure: Default ``7``. Max failures before exponential backoff terminates\r\n\r\nThe following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.\r\n\r\n* ssh_key_file: Default ``None``. Full path to ``id_rsa`` key file\r\n* ssh_tunnel: Default ``None``. SSH Tunnel in the format ``user@host:port``\r\n* ssh_tunnel_port: Default ``None``. Local port for SSH Tunnel\r\n* ssh_remote_host: Default ``None``. Remote host to connect to within SSH Tunnel\r\n* ssh_remote_port: Default ``None``. Remote port to connect to within SSH Tunnel\r\n\r\nThe following can also be passed via argparse. Argparse will override all options in the configfile, when specified.\r\n\r\n* format: Default ``json``. Options ``[ json, msgpack, string ]``. Format to use when sending to transport\r\n* files: Default ``files``. Space-separated list of files to tail.\r\n* path: Default ``/var/log``. Path glob to tail.\r\n* transport: Default ``stdout``. Transport to use when log changes are detected\r\n* fqdn: Default ``False``. Whether to use the machine's FQDN in transport output\r\n* hostname: Default ``None``. Manually specified hostname\r\n\r\nExamples\r\n--------\r\n\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n beaver --format msgpack\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n beaver --format string\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -p '/var/log' -t redis\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://*:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -m bind -t zmq\r\n\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://indexer:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # on the commandline\r\n beaver -c /etc/beaver.conf -m connect -t zmq\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://redis-internal:6379/0\r\n redis_namespace: app:unmappable\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n rabbitmq_host: 10.0.0.1\r\n\r\n # logstash indexer config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t rabbitmq\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # /etc/beaver.conf:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t stdout\r\n\r\nExample 11: UDP transport::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n udp_host: 127.0.0.1\r\n udp_port: 9999\r\n\r\n # logstash indexer config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t udp\r\n\r\nTodo\r\n====\r\n\r\n* More documentation\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* ~~Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution~~\r\n* More transports\r\n* ~~Ability to specify files, tags, and other metadata within a configuration file~~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis"} \ No newline at end of file +{"body":"Requirements\r\n============\r\n\r\n* Python 2.6+\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==21\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-c CONFIG] [-d] [-D] [-f FILES [FILES ...]]\r\n [-F {json,msgpack,string}] [-H HOSTNAME] [-m {bind,connect}]\r\n [-o OUTPUT] [-p PATH] [-P PID]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-v] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d, --debug enable debug mode\r\n -D, --daemonize daemonize in the background\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -F {json,msgpack,string}, --format {json,msgpack,string}\r\n format to use when sending to transport\r\n -H HOSTNAME, --hostname HOSTNAME\r\n manual hostname override for source_host\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -o OUTPUT, --output OUTPUT\r\n file to pipe output to (in addition to stdout)\r\n -p PATH, --path PATH path to log files\r\n -P PID, --pid PID path to pid file\r\n -t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp}\r\n log transport method\r\n -v, --version output version and quit\r\n --fqdn use the machine's FQDN for source_host\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this, or you may configure beaver to do otherwise.\r\n\r\nConfiguration File Options\r\n--------------------------\r\n\r\nBeaver can optionally get data from a ``configfile`` using the ``-c`` flag. This file is in ``ini`` format. Global configuration will be under the ``beaver`` stanza. The following are global beaver configuration keys with their respective meanings:\r\n\r\n* rabbitmq_host: Defaults ``localhost``. Host for RabbitMQ.\r\n* rabbitmq_port: Defaults ``5672``. Port for RabbitMQ.\r\n* rabbitmq_vhost: Default ``/``\r\n* rabbitmq_username: Default ``guest``\r\n* rabbitmq_password: Default ``guest``\r\n* rabbitmq_queue: Default ``logstash-queue``.\r\n* rabbitmq_exchange: Default ``direct``.\r\n* rabbitmq_exchange_durable: Default ``0``.\r\n* rabbitmq_key: Default ``logstash-key``.\r\n* rabbitmq_exchange: Default ``logstash-exchange``.\r\n* redis_url: Default ``redis://localhost:6379/0``. Redis URL\r\n* redis_namespace: Default ``logstash:beaver``. Redis key namespace\r\n* udp_host: Default ``127.0.0.1``. UDP Host\r\n* udp_port: Default ``9999``. UDP Port\r\n* zeromq_address: Default ``tcp://localhost:2120``. Zeromq URL\r\n* zeromq_bind: Default ``bind``. Whether to bind to zeromq host or simply connect\r\n\r\nThe following are used for instances when a TransportException is thrown - Transport dependent\r\n\r\n* respawn_delay: Default ``3``. Initial respawn delay for exponential backoff\r\n* max_failure: Default ``7``. Max failures before exponential backoff terminates\r\n\r\nThe following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.\r\n\r\n* ssh_key_file: Default ``None``. Full path to ``id_rsa`` key file\r\n* ssh_tunnel: Default ``None``. SSH Tunnel in the format ``user@host:port``\r\n* ssh_tunnel_port: Default ``None``. Local port for SSH Tunnel\r\n* ssh_remote_host: Default ``None``. Remote host to connect to within SSH Tunnel\r\n* ssh_remote_port: Default ``None``. Remote port to connect to within SSH Tunnel\r\n\r\nThe following can also be passed via argparse. Argparse will override all options in the configfile, when specified.\r\n\r\n* format: Default ``json``. Options ``[ json, msgpack, string ]``. Format to use when sending to transport\r\n* files: Default ``files``. Space-separated list of files to tail.\r\n* path: Default ``/var/log``. Path glob to tail.\r\n* transport: Default ``stdout``. Transport to use when log changes are detected\r\n* fqdn: Default ``False``. Whether to use the machine's FQDN in transport output\r\n* hostname: Default ``None``. Manually specified hostname\r\n\r\nExamples\r\n--------\r\n\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n beaver --format msgpack\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n beaver --format string\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -p '/var/log' -t redis\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://*:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -m bind -t zmq\r\n\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://indexer:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # on the commandline\r\n beaver -c /etc/beaver.conf -m connect -t zmq\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://redis-internal:6379/0\r\n redis_namespace: app:unmappable\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n rabbitmq_host: 10.0.0.1\r\n\r\n # logstash indexer config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t rabbitmq\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # /etc/beaver.conf:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t stdout\r\n\r\nExample 11: UDP transport::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n udp_host: 127.0.0.1\r\n udp_port: 9999\r\n\r\n # logstash indexer config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t udp\r\n\r\nTodo\r\n====\r\n\r\n* More documentation\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* ~~Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution~~\r\n* More transports\r\n* ~~Ability to specify files, tags, and other metadata within a configuration file~~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","tagline":"python daemon that munches on logs and sends their contents to logstash"} \ No newline at end of file From 564f99939f5d1c3bfa48b0afbdb453a3d587e044 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 24 May 2013 14:58:01 -0700 Subject: [PATCH 14/14] Create gh-pages branch via GitHub --- index.html | 193 +++++++++++++++++++++++++++++++++++++++------------- params.json | 2 +- 2 files changed, 148 insertions(+), 47 deletions(-) diff --git a/index.html b/index.html index 295040ca..1578cdb4 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@

    Requirements

    From PyPI::

    -
    pip install beaver==21
    +
    pip install beaver==29
     

    Usage

    @@ -55,9 +55,9 @@

    Usage

    usage::

    beaver [-h] [-c CONFIG] [-d] [-D] [-f FILES [FILES ...]]
    -       [-F {json,msgpack,string}] [-H HOSTNAME] [-m {bind,connect}]
    -       [-o OUTPUT] [-p PATH] [-P PID]
    -       [-t {rabbitmq,redis,stdout,zmq,udp}] [-v] [--fqdn]
    +       [-F {json,msgpack,raw,rawjson,string}] [-H HOSTNAME] [-m {bind,connect}]
    +       [-l OUTPUT] [-p PATH] [-P PID]
    +       [-t {mqtt,rabbitmq,redis,sqs,stdout,udp,zmq}] [-v] [--fqdn]
     

    optional arguments::

    @@ -70,17 +70,17 @@

    Usage

    -f FILES [FILES ...], --files FILES [FILES ...] space-separated filelist to watch, can include globs (*.log). Overrides --path argument --F {json,msgpack,string}, --format {json,msgpack,string} +-F {json,msgpack,raw,rawjson,string}, --format {json,msgpack,raw,rawjson,string} format to use when sending to transport -H HOSTNAME, --hostname HOSTNAME manual hostname override for source_host -m {bind,connect}, --mode {bind,connect} bind or connect mode --o OUTPUT, --output OUTPUT +-l OUTPUT, --logfile OUTPUT, -o OUTPUT, --output OUTPUT file to pipe output to (in addition to stdout) -p PATH, --path PATH path to log files -P PID, --pid PID path to pid file --t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp} +-t {mqtt,rabbitmq,redis,stdout,udp,zmq}, --transport {mqtt,rabbitmq,redis,sqs,stdout,udp,zmq} log transport method -v, --version output version and quit --fqdn use the machine's FQDN for source_host @@ -88,7 +88,7 @@

    Usage

    Background

    -

    Beaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.

    +

    Beaver provides an lightweight method for shipping local log files to Logstash. It does this using redis, zeromq, udp, rabbit or stdout as the transport. This means you'll need a redis, zeromq, udp, amqp or stdin 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.

    @@ -99,8 +99,13 @@

    Configuration File Options

    Beaver can optionally get data from a configfile using the -c flag. This file is in ini format. Global configuration will be under the beaver stanza. The following are global beaver configuration keys with their respective meanings:

      -
    • rabbitmq_host: Defaults localhost. Host for RabbitMQ.
    • -
    • rabbitmq_port: Defaults 5672. Port for RabbitMQ.
    • +
    • mqtt_host: Default localhost. Host for mosquitto
    • +
    • mqtt_port: Default 1883. Port for mosquitto
    • +
    • mqtt_clientid: Default mosquitto. Mosquitto client id
    • +
    • mqtt_keepalive: Default 60. mqtt keepalive ping
    • +
    • mqtt_topic: Default /logstash. Topic to publish to
    • +
    • rabbitmq_host: Defaults localhost. Host for RabbitMQ
    • +
    • rabbitmq_port: Defaults 5672. Port for RabbitMQ
    • rabbitmq_vhost: Default /
    • rabbitmq_username: Default guest @@ -108,21 +113,30 @@

      Configuration File Options

    • rabbitmq_password: Default guest
    • rabbitmq_queue: Default logstash-queue.
    • -
    • rabbitmq_exchange: Default direct.
    • +
    • rabbitmq_exchange_type: Default direct.
    • rabbitmq_exchange_durable: Default 0.
    • rabbitmq_key: Default logstash-key.
    • rabbitmq_exchange: Default logstash-exchange.
    • redis_url: Default redis://localhost:6379/0. Redis URL
    • redis_namespace: Default logstash:beaver. Redis key namespace
    • +
    • sqs_aws_access_key: Can be left blank to use IAM Roles or AWS_ACCESS_KEY_ID environment variable (see: https://github.com/boto/boto#getting-started-with-boto)
    • +
    • sqs_aws_secret_key: Can be left blank to use IAM Roles or AWS_SECRET_ACCESS_KEY environment variable (see: https://github.com/boto/boto#getting-started-with-boto)
    • +
    • sqs_aws_region: Default us-east-1. AWS Region
    • +
    • sqs_aws_queue: SQS queue (must exist)
    • udp_host: Default 127.0.0.1. UDP Host
    • udp_port: Default 9999. UDP Port
    • zeromq_address: Default tcp://localhost:2120. Zeromq URL
    • +
    • zeromq_hwm: Default None. Zeromq HighWaterMark socket option
    • zeromq_bind: Default bind. Whether to bind to zeromq host or simply connect

    The following are used for instances when a TransportException is thrown - Transport dependent

    • respawn_delay: Default 3. Initial respawn delay for exponential backoff
    • max_failure: Default 7. Max failures before exponential backoff terminates
    • +

    The following configuration keys are for SinceDB support. Specifying these will enable saving the current line number in an sqlite database. This is useful for cases where you may be restarting the beaver process, such as during a logrotate.

    + +
      +
    • sincedb_path: Default None. Full path to an sqlite3 database. Will be created at this path if it does not exist. Beaver process must have read and write access

    The following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.

      @@ -136,7 +150,7 @@

      Configuration File Options

      • format: Default json. Options [ json, msgpack, string ]. Format to use when sending to transport
      • -
      • files: Default files. Space-separated list of files to tail.
      • +
      • files: Default files. Space-separated list of files to tail. (Comma separated if specified in the config file)
      • path: Default /var/log. Path glob to tail.
      • transport: Default stdout. Transport to use when log changes are detected
      • fqdn: Default False. Whether to use the machine's FQDN in transport output
      • @@ -160,27 +174,17 @@

        Configuration File Options

        Example 4: Sending logs from /var/log files to a redis list::

        -
        # /etc/beaver.conf
        -[beaver]
        -redis_url: redis://localhost:6379/0
        -
        -# From the commandline
        -beaver  -c /etc/beaver.conf -t redis
        -
        - -

        Example 5: Use environment variables to send logs from /var/log files to a redis list::

        - -
        # /etc/beaver.conf
        +
        # /etc/beaver/conf
         [beaver]
         redis_url: redis://localhost:6379/0
         
         # From the commandline
        -beaver  -c /etc/beaver.conf -p '/var/log' -t redis
        +beaver  -c /etc/beaver/conf -t redis
         
        -

        Example 6: Zeromq listening on port 5556 (all interfaces)::

        +

        Example 5: Zeromq listening on port 5556 (all interfaces)::

        -
        # /etc/beaver.conf
        +
        # /etc/beaver/conf
         [beaver]
         zeromq_address: tcp://*:5556
         
        @@ -196,12 +200,12 @@ 

        Configuration File Options

        output { stdout { debug => true } } # From the commandline -beaver -c /etc/beaver.conf -m bind -t zmq +beaver -c /etc/beaver/conf -m bind -t zmq
        -

        Example 7: Zeromq connecting to remote port 5556 on indexer::

        +

        Example 6: Zeromq connecting to remote port 5556 on indexer::

        -
        # /etc/beaver.conf
        +
        # /etc/beaver/conf
         [beaver]
         zeromq_address: tcp://indexer:5556
         
        @@ -217,15 +221,15 @@ 

        Configuration File Options

        output { stdout { debug => true } } # on the commandline -beaver -c /etc/beaver.conf -m connect -t zmq +beaver -c /etc/beaver/conf -m connect -t zmq
        -

        Example 8: Real-world usage of Redis as a transport::

        +

        Example 7: Real-world usage of Redis as a transport::

        # in /etc/hosts
         192.168.0.10 redis-internal
         
        -# /etc/beaver.conf
        +# /etc/beaver/conf
         [beaver]
         redis_url: redis://redis-internal:6379/0
         redis_namespace: app:unmappable
        @@ -242,14 +246,12 @@ 

        Configuration File Options

        output { stdout { debug => true } } # From the commandline -beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis +beaver -c /etc/beaver/conf -f /var/log/unmappable.log -t redis
        -

        As you can see, beaver is pretty flexible as to how you can use/abuse it in production.

        - -

        Example 9: RabbitMQ connecting to defaults on remote broker::

        +

        Example 8: RabbitMQ connecting to defaults on remote broker::

        -
        # /etc/beaver.conf
        +
        # /etc/beaver/conf
         [beaver]
         rabbitmq_host: 10.0.0.1
         
        @@ -268,32 +270,36 @@ 

        Configuration File Options

        output { stdout { debug => true } } # From the commandline -beaver -c /etc/beaver.conf -t rabbitmq +beaver -c /etc/beaver/conf -t rabbitmq
        -

        Example 10: Read config from config.ini and put to stdout::

        +

        Example 9: Read config from config.ini and put to stdout::

        -
        # /etc/beaver.conf:
        +
        # /etc/beaver/conf:
        +; follow a single file, add a type, some tags and fields
         [/tmp/somefile]
         type: mytype
         tags: tag1,tag2
         add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]
         
        +; follow all logs in /var/log except those with `messages` or `secure` in the name
         [/var/log/*log]
         type: syslog
         tags: sys
        +exclude: (messages,secure)
         
        -[/var/log/{secure,messages}.log]
        +; follow /var/log/messages.log and /var/log/secure.log using file globbing
        +[/var/log/{messages,secure}.log]
         type: syslog
         tags: sys
         
         # From the commandline
        -beaver -c /etc/beaver.conf -t stdout
        +beaver -c /etc/beaver/conf -t stdout
         
        -

        Example 11: UDP transport::

        +

        Example 10: UDP transport::

        -
        # /etc/beaver.conf
        +
        # /etc/beaver/conf
         [beaver]
         udp_host: 127.0.0.1
         udp_port: 9999
        @@ -309,14 +315,109 @@ 

        Configuration File Options

        output { stdout { debug => true } } # From the commandline -beaver -c /etc/beaver.conf -t udp +beaver -c /etc/beaver/conf -t udp +
        + +

        Example 11: SQS Transport::

        + +
        # /etc/beaver/conf
        +[beaver]
        +sqs_aws_region: us-east-1
        +sqs_aws_queue: logstash-input
        +sqs_aws_access_key: <access_key>
        +sqs_aws_secret_access_key: <secret_key>
        +
        +# logstash indexer config:
        +input {
        +  sqs {
        +    queue => "logstash-input"
        +    type => "shipper-input"
        +    format => "json_event"
        +    access_key => "<access_key>"
        +    secret_key => "<secret_key>"
        +  }
        +}
        +output { stdout { debug => true } }
        +
        +# From the commandline
        +beaver -c /etc/beaver/conf -t sqs
        +
        + +

        Example 12: [Raw Json Support](http://blog.pkhamre.com/2012/08/23/logging-to-logstash-json-format-in-nginx/::

        + +
        beaver --format rawjson
        +
        + +

        Example 13: Mqtt transport using Mosquitto::

        + +
        # /etc/beaver/conf
        +[beaver]
        +mqtt_client_id: 'beaver_client'
        +mqtt_topic: '/logstash'
        +mqtt_host: '127.0.0.1'
        +mqtt_port: '1318'
        +mqtt_keepalive: '60'
        +
        +# logstash indexer config:
        +input {
        +  mqtt {
        +    host => '127.0.0.1'
        +    data_type => 'list'
        +    key => 'app:unmappable'
        +    type => 'app:unmappable'
        +  }
        +}
        +output { stdout { debug => true } }
        +
        +# From the commandline
        +beaver -c /etc/beaver/conf -f /var/log/unmappable.log -t mqtt
         
        +

        Example 14: Sincedb support using and sqlite3 db

        + +

        Note that this will require R/W permissions on the file at sincedb path, as Beaver will store the current line for a given filename/file id.::

        + +
        # /etc/beaver/conf
        +[beaver]
        +sincedb_path: /etc/beaver/since.db
        +
        +[/var/log/syslog]
        +type: syslog
        +tags: sys,main
        +sincedb_write_interval: 3 ; time in seconds
        +
        +# From the commandline
        +beaver -c /etc/beaver/conf
        +
        + +

        Example 15: Loading stanzas from /etc/beaver/conf.d/* support::

        + +
        # /etc/beaver/conf
        +[beaver]
        +format: json
        +
        +# /etc/beaver/conf.d/syslog
        +[/var/log/syslog]
        +type: syslog
        +tags: sys,main
        +
        +# /etc/beaver/conf.d/nginx
        +[/var/log/nginx]
        +format: rawjson
        +type: nginx
        +tags: nginx,server
        +
        +# From the commandline
        +beaver -c /etc/beaver/conf
        +
        + +

        As you can see, beaver is pretty flexible as to how you can use/abuse it in production.

        +

        Todo

        • More documentation
        • -
        • Use python threading + subprocess in order to support usage of yield across all operating systems
        • +
        • Use python threading + subprocess in order to support usage of yield across all operating systems
        • Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution
        • More transports
        • Ability to specify files, tags, and other metadata within a configuration file
        • diff --git a/params.json b/params.json index d6d6666d..c6bf0e96 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"body":"Requirements\r\n============\r\n\r\n* Python 2.6+\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==21\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-c CONFIG] [-d] [-D] [-f FILES [FILES ...]]\r\n [-F {json,msgpack,string}] [-H HOSTNAME] [-m {bind,connect}]\r\n [-o OUTPUT] [-p PATH] [-P PID]\r\n [-t {rabbitmq,redis,stdout,zmq,udp}] [-v] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d, --debug enable debug mode\r\n -D, --daemonize daemonize in the background\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -F {json,msgpack,string}, --format {json,msgpack,string}\r\n format to use when sending to transport\r\n -H HOSTNAME, --hostname HOSTNAME\r\n manual hostname override for source_host\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -o OUTPUT, --output OUTPUT\r\n file to pipe output to (in addition to stdout)\r\n -p PATH, --path PATH path to log files\r\n -P PID, --pid PID path to pid file\r\n -t {rabbitmq,redis,stdout,zmq,udp}, --transport {rabbitmq,redis,stdout,zmq,udp}\r\n log transport method\r\n -v, --version output version and quit\r\n --fqdn use the machine's FQDN for source_host\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using either redis, stdin, zeromq as the transport. This means you'll need a redis, stdin, zeromq input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this, or you may configure beaver to do otherwise.\r\n\r\nConfiguration File Options\r\n--------------------------\r\n\r\nBeaver can optionally get data from a ``configfile`` using the ``-c`` flag. This file is in ``ini`` format. Global configuration will be under the ``beaver`` stanza. The following are global beaver configuration keys with their respective meanings:\r\n\r\n* rabbitmq_host: Defaults ``localhost``. Host for RabbitMQ.\r\n* rabbitmq_port: Defaults ``5672``. Port for RabbitMQ.\r\n* rabbitmq_vhost: Default ``/``\r\n* rabbitmq_username: Default ``guest``\r\n* rabbitmq_password: Default ``guest``\r\n* rabbitmq_queue: Default ``logstash-queue``.\r\n* rabbitmq_exchange: Default ``direct``.\r\n* rabbitmq_exchange_durable: Default ``0``.\r\n* rabbitmq_key: Default ``logstash-key``.\r\n* rabbitmq_exchange: Default ``logstash-exchange``.\r\n* redis_url: Default ``redis://localhost:6379/0``. Redis URL\r\n* redis_namespace: Default ``logstash:beaver``. Redis key namespace\r\n* udp_host: Default ``127.0.0.1``. UDP Host\r\n* udp_port: Default ``9999``. UDP Port\r\n* zeromq_address: Default ``tcp://localhost:2120``. Zeromq URL\r\n* zeromq_bind: Default ``bind``. Whether to bind to zeromq host or simply connect\r\n\r\nThe following are used for instances when a TransportException is thrown - Transport dependent\r\n\r\n* respawn_delay: Default ``3``. Initial respawn delay for exponential backoff\r\n* max_failure: Default ``7``. Max failures before exponential backoff terminates\r\n\r\nThe following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.\r\n\r\n* ssh_key_file: Default ``None``. Full path to ``id_rsa`` key file\r\n* ssh_tunnel: Default ``None``. SSH Tunnel in the format ``user@host:port``\r\n* ssh_tunnel_port: Default ``None``. Local port for SSH Tunnel\r\n* ssh_remote_host: Default ``None``. Remote host to connect to within SSH Tunnel\r\n* ssh_remote_port: Default ``None``. Remote port to connect to within SSH Tunnel\r\n\r\nThe following can also be passed via argparse. Argparse will override all options in the configfile, when specified.\r\n\r\n* format: Default ``json``. Options ``[ json, msgpack, string ]``. Format to use when sending to transport\r\n* files: Default ``files``. Space-separated list of files to tail.\r\n* path: Default ``/var/log``. Path glob to tail.\r\n* transport: Default ``stdout``. Transport to use when log changes are detected\r\n* fqdn: Default ``False``. Whether to use the machine's FQDN in transport output\r\n* hostname: Default ``None``. Manually specified hostname\r\n\r\nExamples\r\n--------\r\n\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n beaver --format msgpack\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n beaver --format string\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t redis\r\n\r\nExample 5: Use environment variables to send logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -p '/var/log' -t redis\r\n\r\nExample 6: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://*:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -m bind -t zmq\r\n\r\n\r\nExample 7: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n zeromq_address: tcp://indexer:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # on the commandline\r\n beaver -c /etc/beaver.conf -m connect -t zmq\r\n\r\nExample 8: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n redis_url: redis://redis-internal:6379/0\r\n redis_namespace: app:unmappable\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -f /var/log/unmappable.log -t redis\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nExample 9: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n rabbitmq_host: 10.0.0.1\r\n\r\n # logstash indexer config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t rabbitmq\r\n\r\nExample 10: Read config from config.ini and put to stdout::\r\n\r\n # /etc/beaver.conf:\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n\r\n [/var/log/{secure,messages}.log]\r\n type: syslog\r\n tags: sys\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t stdout\r\n\r\nExample 11: UDP transport::\r\n\r\n # /etc/beaver.conf\r\n [beaver]\r\n udp_host: 127.0.0.1\r\n udp_port: 9999\r\n\r\n # logstash indexer config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver.conf -t udp\r\n\r\nTodo\r\n====\r\n\r\n* More documentation\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* ~~Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution~~\r\n* More transports\r\n* ~~Ability to specify files, tags, and other metadata within a configuration file~~\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Beaver","tagline":"python daemon that munches on logs and sends their contents to logstash"} \ No newline at end of file +{"name":"Beaver","tagline":"python daemon that munches on logs and sends their contents to logstash","body":"Requirements\r\n============\r\n\r\n* Python 2.6+\r\n* Optional zeromq support: install libzmq (``brew install zmq`` or ``apt-get install libzmq-dev``) and pyzmq (``pip install pyzmq==2.1.11``)\r\n\r\nInstallation\r\n============\r\n\r\nUsing PIP:\r\n\r\nFrom Github::\r\n\r\n pip install git+git://github.com/josegonzalez/beaver.git#egg=beaver\r\n\r\nFrom PyPI::\r\n\r\n pip install beaver==29\r\n\r\nUsage\r\n=====\r\n\r\nusage::\r\n\r\n beaver [-h] [-c CONFIG] [-d] [-D] [-f FILES [FILES ...]]\r\n [-F {json,msgpack,raw,rawjson,string}] [-H HOSTNAME] [-m {bind,connect}]\r\n [-l OUTPUT] [-p PATH] [-P PID]\r\n [-t {mqtt,rabbitmq,redis,sqs,stdout,udp,zmq}] [-v] [--fqdn]\r\n\r\noptional arguments::\r\n\r\n -h, --help show this help message and exit\r\n -c CONFIG, --configfile CONFIG\r\n ini config file path\r\n -d, --debug enable debug mode\r\n -D, --daemonize daemonize in the background\r\n -f FILES [FILES ...], --files FILES [FILES ...]\r\n space-separated filelist to watch, can include globs\r\n (*.log). Overrides --path argument\r\n -F {json,msgpack,raw,rawjson,string}, --format {json,msgpack,raw,rawjson,string}\r\n format to use when sending to transport\r\n -H HOSTNAME, --hostname HOSTNAME\r\n manual hostname override for source_host\r\n -m {bind,connect}, --mode {bind,connect}\r\n bind or connect mode\r\n -l OUTPUT, --logfile OUTPUT, -o OUTPUT, --output OUTPUT\r\n file to pipe output to (in addition to stdout)\r\n -p PATH, --path PATH path to log files\r\n -P PID, --pid PID path to pid file\r\n -t {mqtt,rabbitmq,redis,stdout,udp,zmq}, --transport {mqtt,rabbitmq,redis,sqs,stdout,udp,zmq}\r\n log transport method\r\n -v, --version output version and quit\r\n --fqdn use the machine's FQDN for source_host\r\n\r\nBackground\r\n==========\r\n\r\nBeaver provides an lightweight method for shipping local log files to Logstash. It does this using redis, zeromq, udp, rabbit or stdout as the transport. This means you'll need a redis, zeromq, udp, amqp or stdin input somewhere down the road to get the events.\r\n\r\nEvents are sent in logstash's ``json_event`` format. Options can also be set as environment variables.\r\n\r\nNOTE: the redis transport uses a namespace of ``logstash:beaver`` by default. You will need to update your logstash indexer to match this, or you may configure beaver to do otherwise.\r\n\r\nConfiguration File Options\r\n--------------------------\r\n\r\nBeaver can optionally get data from a ``configfile`` using the ``-c`` flag. This file is in ``ini`` format. Global configuration will be under the ``beaver`` stanza. The following are global beaver configuration keys with their respective meanings:\r\n\r\n* mqtt_host: Default ``localhost``. Host for mosquitto\r\n* mqtt_port: Default ``1883``. Port for mosquitto\r\n* mqtt_clientid: Default ``mosquitto``. Mosquitto client id\r\n* mqtt_keepalive: Default ``60``. mqtt keepalive ping\r\n* mqtt_topic: Default ``/logstash``. Topic to publish to\r\n* rabbitmq_host: Defaults ``localhost``. Host for RabbitMQ\r\n* rabbitmq_port: Defaults ``5672``. Port for RabbitMQ\r\n* rabbitmq_vhost: Default ``/``\r\n* rabbitmq_username: Default ``guest``\r\n* rabbitmq_password: Default ``guest``\r\n* rabbitmq_queue: Default ``logstash-queue``.\r\n* rabbitmq_exchange_type: Default ``direct``.\r\n* rabbitmq_exchange_durable: Default ``0``.\r\n* rabbitmq_key: Default ``logstash-key``.\r\n* rabbitmq_exchange: Default ``logstash-exchange``.\r\n* redis_url: Default ``redis://localhost:6379/0``. Redis URL\r\n* redis_namespace: Default ``logstash:beaver``. Redis key namespace\r\n* sqs_aws_access_key: Can be left blank to use IAM Roles or AWS_ACCESS_KEY_ID environment variable (see: https://github.com/boto/boto#getting-started-with-boto)\r\n* sqs_aws_secret_key: Can be left blank to use IAM Roles or AWS_SECRET_ACCESS_KEY environment variable (see: https://github.com/boto/boto#getting-started-with-boto)\r\n* sqs_aws_region: Default ``us-east-1``. AWS Region\r\n* sqs_aws_queue: SQS queue (must exist)\r\n* udp_host: Default ``127.0.0.1``. UDP Host\r\n* udp_port: Default ``9999``. UDP Port\r\n* zeromq_address: Default ``tcp://localhost:2120``. Zeromq URL\r\n* zeromq_hwm: Default None. Zeromq HighWaterMark socket option\r\n* zeromq_bind: Default ``bind``. Whether to bind to zeromq host or simply connect\r\n\r\nThe following are used for instances when a TransportException is thrown - Transport dependent\r\n\r\n* respawn_delay: Default ``3``. Initial respawn delay for exponential backoff\r\n* max_failure: Default ``7``. Max failures before exponential backoff terminates\r\n\r\nThe following configuration keys are for SinceDB support. Specifying these will enable saving the current line number in an sqlite database. This is useful for cases where you may be restarting the beaver process, such as during a logrotate.\r\n\r\n* sincedb_path: Default ``None``. Full path to an ``sqlite3`` database. Will be created at this path if it does not exist. Beaver process must have read and write access\r\n\r\nThe following configuration keys are for building an SSH Tunnel that can be used to proxy from the current host to a desired server. This proxy is torn down when Beaver halts in all cases.\r\n\r\n* ssh_key_file: Default ``None``. Full path to ``id_rsa`` key file\r\n* ssh_tunnel: Default ``None``. SSH Tunnel in the format ``user@host:port``\r\n* ssh_tunnel_port: Default ``None``. Local port for SSH Tunnel\r\n* ssh_remote_host: Default ``None``. Remote host to connect to within SSH Tunnel\r\n* ssh_remote_port: Default ``None``. Remote port to connect to within SSH Tunnel\r\n\r\nThe following can also be passed via argparse. Argparse will override all options in the configfile, when specified.\r\n\r\n* format: Default ``json``. Options ``[ json, msgpack, string ]``. Format to use when sending to transport\r\n* files: Default ``files``. Space-separated list of files to tail. (Comma separated if specified in the config file)\r\n* path: Default ``/var/log``. Path glob to tail.\r\n* transport: Default ``stdout``. Transport to use when log changes are detected\r\n* fqdn: Default ``False``. Whether to use the machine's FQDN in transport output\r\n* hostname: Default ``None``. Manually specified hostname\r\n\r\nExamples\r\n--------\r\n\r\n\r\nExample 1: Listen to all files in the default path of /var/log on standard out as json::\r\n\r\n beaver\r\n\r\nExample 2: Listen to all files in the default path of /var/log on standard out with msgpack::\r\n\r\n beaver --format msgpack\r\n\r\nExample 3: Listen to all files in the default path of /var/log on standard out as a string::\r\n\r\n beaver --format string\r\n\r\nExample 4: Sending logs from /var/log files to a redis list::\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n redis_url: redis://localhost:6379/0\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf -t redis\r\n\r\nExample 5: Zeromq listening on port 5556 (all interfaces)::\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n zeromq_address: tcp://*:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'client'\r\n topology => 'pushpull'\r\n address => 'tcp://shipperhost:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf -m bind -t zmq\r\n\r\n\r\nExample 6: Zeromq connecting to remote port 5556 on indexer::\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n zeromq_address: tcp://indexer:5556\r\n\r\n # logstash indexer config:\r\n input {\r\n zeromq {\r\n type => 'shipper-input'\r\n mode => 'server'\r\n topology => 'pushpull'\r\n address => 'tcp://*:5556'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # on the commandline\r\n beaver -c /etc/beaver/conf -m connect -t zmq\r\n\r\nExample 7: Real-world usage of Redis as a transport::\r\n\r\n # in /etc/hosts\r\n 192.168.0.10 redis-internal\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n redis_url: redis://redis-internal:6379/0\r\n redis_namespace: app:unmappable\r\n\r\n # logstash indexer config:\r\n input {\r\n redis {\r\n host => 'redis-internal'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf -f /var/log/unmappable.log -t redis\r\n\r\nExample 8: RabbitMQ connecting to defaults on remote broker::\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n rabbitmq_host: 10.0.0.1\r\n\r\n # logstash indexer config:\r\n input { amqp {\r\n name => 'logstash-queue'\r\n type => 'direct'\r\n host => '10.0.0.1'\r\n exchange => 'logstash-exchange'\r\n key => 'logstash-key'\r\n exclusive => false\r\n durable => false\r\n auto_delete => false\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf -t rabbitmq\r\n\r\nExample 9: Read config from config.ini and put to stdout::\r\n\r\n # /etc/beaver/conf:\r\n ; follow a single file, add a type, some tags and fields\r\n [/tmp/somefile]\r\n type: mytype\r\n tags: tag1,tag2\r\n add_field: fieldname1,fieldvalue1[,fieldname2,fieldvalue2, ...]\r\n\r\n ; follow all logs in /var/log except those with `messages` or `secure` in the name\r\n [/var/log/*log]\r\n type: syslog\r\n tags: sys\r\n exclude: (messages,secure)\r\n\r\n ; follow /var/log/messages.log and /var/log/secure.log using file globbing\r\n [/var/log/{messages,secure}.log]\r\n type: syslog\r\n tags: sys\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf -t stdout\r\n\r\nExample 10: UDP transport::\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n udp_host: 127.0.0.1\r\n udp_port: 9999\r\n\r\n # logstash indexer config:\r\n input {\r\n udp {\r\n type => 'shipper-input'\r\n host => '127.0.0.1'\r\n port => '9999'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf -t udp\r\n\r\nExample 11: SQS Transport::\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n sqs_aws_region: us-east-1\r\n sqs_aws_queue: logstash-input\r\n sqs_aws_access_key: \r\n sqs_aws_secret_access_key: \r\n\r\n # logstash indexer config:\r\n input {\r\n sqs {\r\n queue => \"logstash-input\"\r\n type => \"shipper-input\"\r\n format => \"json_event\"\r\n access_key => \"\"\r\n secret_key => \"\"\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf -t sqs\r\n\r\nExample 12: [Raw Json Support](http://blog.pkhamre.com/2012/08/23/logging-to-logstash-json-format-in-nginx/::\r\n\r\n beaver --format rawjson\r\n\r\nExample 13: Mqtt transport using Mosquitto::\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n mqtt_client_id: 'beaver_client'\r\n mqtt_topic: '/logstash'\r\n mqtt_host: '127.0.0.1'\r\n mqtt_port: '1318'\r\n mqtt_keepalive: '60'\r\n\r\n # logstash indexer config:\r\n input {\r\n mqtt {\r\n host => '127.0.0.1'\r\n data_type => 'list'\r\n key => 'app:unmappable'\r\n type => 'app:unmappable'\r\n }\r\n }\r\n output { stdout { debug => true } }\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf -f /var/log/unmappable.log -t mqtt\r\n\r\nExample 14: Sincedb support using and sqlite3 db\r\n\r\nNote that this will require R/W permissions on the file at sincedb path, as Beaver will store the current line for a given filename/file id.::\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n sincedb_path: /etc/beaver/since.db\r\n\r\n [/var/log/syslog]\r\n type: syslog\r\n tags: sys,main\r\n sincedb_write_interval: 3 ; time in seconds\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf\r\n\r\nExample 15: Loading stanzas from /etc/beaver/conf.d/* support::\r\n\r\n # /etc/beaver/conf\r\n [beaver]\r\n format: json\r\n\r\n # /etc/beaver/conf.d/syslog\r\n [/var/log/syslog]\r\n type: syslog\r\n tags: sys,main\r\n\r\n # /etc/beaver/conf.d/nginx\r\n [/var/log/nginx]\r\n format: rawjson\r\n type: nginx\r\n tags: nginx,server\r\n\r\n # From the commandline\r\n beaver -c /etc/beaver/conf\r\n\r\n\r\nAs you can see, ``beaver`` is pretty flexible as to how you can use/abuse it in production.\r\n\r\nTodo\r\n====\r\n\r\n* More documentation\r\n* Use python threading + subprocess in order to support usage of ``yield`` across all operating systems\r\n* Fix usage on non-linux platforms - file.readline() does not work as expected on OS X. See above for potential solution\r\n* More transports\r\n* Ability to specify files, tags, and other metadata within a configuration file\r\n\r\nCaveats\r\n=======\r\n\r\nWhen using ``copytruncate`` style log rotation, two race conditions can occur:\r\n\r\n1. Any log data written prior to truncation which beaver has not yet\r\n read and processed is lost. Nothing we can do about that.\r\n\r\n2. Should the file be truncated, rewritten, and end up being larger than\r\n the original file during the sleep interval, beaver won't detect\r\n this. After some experimentation, this behavior also exists in GNU\r\n tail, so I'm going to call this a \"don't do that then\" bug :)\r\n\r\n Additionally, the files beaver will most likely be called upon to\r\n watch which may be truncated are generally going to be large enough\r\n and slow-filling enough that this won't crop up in the wild.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nBased on work from Giampaolo and Lusis::\r\n\r\n Real time log files watcher supporting log rotation.\r\n\r\n Original Author: Giampaolo Rodola' \r\n http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/\r\n\r\n License: MIT\r\n\r\n Other hacks (ZMQ, JSON, optparse, ...): lusis\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file