GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SCRIBE_CAT(1) User Contributed Perl Documentation SCRIBE_CAT(1)

scribe_cat.pl - Reads log messages from standard input and sends to a scribe instance

  scribe_cat.pl --host=HOST --port=PORT --level=LEVEL --category=CATEGORY

  # Example Apache CustomLog entry
  CustomLog "|scribe_cat.pl --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.

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/scribe_cat.pl --category-re 'local$1= /\?p=([^ ]+)'

would be specified in the configuration file as:

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

--host, --port
Host and port of Scribe server. Defaults to localhost, port 1463.
--category=CATEGORY
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.

Example:

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

  Log Message       |     Category  |     Notes
  --------------------------------------------------
  www.acme.com xyz  | fooacme.com   | Back-subst of acme.com
  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, <http://httpd.apache.org/docs/2.2/logs.html#piped>

Jon Schutz, "<jon at jschutz.net>" <http://notes.jschutz.net>

Please report any bugs or feature requests to "bug-log-logdispatch-scribe at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Log-Dispatch-Scribe>. 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.

    perldoc scribe_cat.pl

You can also look for information at:

  • RT: CPAN's request tracker

    <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Log-Dispatch-Scribe>

  • AnnoCPAN: Annotated CPAN documentation

    <http://annocpan.org/dist/Log-Dispatch-Scribe>

  • CPAN Ratings

    <http://cpanratings.perl.org/d/Log-Dispatch-Scribe>

  • Search CPAN

    <http://search.cpan.org/dist/Log-Dispatch-Scribe/>

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.

2016-05-31 perl v5.32.1

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.