View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Jon Schutz > Log-Dispatch-Scribe >


Annotate this POD


New  1
Open  0
View/Report Bugs

NAME ^ - Reads log messages from standard input and sends to a scribe instance

SYNOPSIS ^ --host=HOST --port=PORT --level=LEVEL --category=CATEGORY

  # Example Apache CustomLog entry
  CustomLog "| --category=www" "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""


A simple script that uses the functionality of Log::Dispatch::Scribe to read from standard input and send to a scribe instance. Offers categorisation by regular expression match on the log message.

Apache Logging

This script is suitable for use with Apache httpd for piped logging per the CustomLog example shown above.

Note that special characters in the command given in the Apache configuration file need to be escaped; for example, this command line:

  /usr/local/bin/ --category-re 'local$1= /\?p=([^ ]+)'

would be specified in the configuration file as:

  CustomLog "|/usr/local/bin/ --category-re \'local$1= /\\\\?p=([^ ]+)\'" combined


--host, --port

Host and port of Scribe server. Defaults to localhost, port 1463.


Default Scribe logging category, used where there is no --category-re or no match on any given category-re.

--category-re CATEGORY=REGEXP [ --category-re CATEGORY=REGEXP ...]

Specify a mapping from regular expression match on each log message to category name. --category-re may be specified more than once to specify a set of mappings. Each mapping is of the form CATEGORY=REGEXP, where CATEGORY is the category name and may include substitutions from the matching expression, using $1, $2 etc. REGEXP is any Perl regexp, using () for grouping to create the $1, $2 references.

The regular expressions are tried in the order that they are specified on the command line, and the first match is used.


    --category-re 'foo$1=www\.([^ ]+)' --category-re bar=BAR --category-re baz='(?i:BAZ)'

  Log Message       |     Category  |     Notes
  -------------------------------------------------- xyz  |   | Back-subst of
  my new BAR baz    | bar           | Matches BAR before BAZ
  bar my new baz    | baz           | Case insensitive match on bar
--retry-plan-a=MODE, --retry-plan-b=MODE, --retry-buffer-size=SIZE, --retry-count=COUNT, --retry-delay=DELAY

See Log::Dispatch::Scribe for full description of these options.

--debug, --debug=FILE

Enable debugging to standard error or to file.


Log::Dispatch::Scribe, File::Tail::Scribe

Apache httpd piped log documentation,


Jon Schutz, <jon at>


Please report any bugs or feature requests to bug-log-logdispatch-scribe at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.


You can also look for information at:


Copyright 2009 Jon Schutz, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: