eris::role::schema - Role for implementing a schema
version 0.005
To implement a schema that takes the processed log entry without field filtering, you could:
package my::app::schema::full; use Moo; with qw(eris::role::schema); sub _build_flatten { 0 } sub _build_use_dictionary { 0 } sub match_log { 1 }
Defaults to a daily index pattern, '%Y.%m.%d' per Logstash.
Defaults to taking the schema's class, trimming off the namespace and then replacing '::' with an underscore. It then joins this with index_name_strftime to form the index name that's evaluated foreach document.
index_name_strftime
Without overriding this via a config element, we get:
Schema Class Index Name -------------------- -------------- eris::schema::syslog yslog-%Y.%m.%d eris::schema::access ccess-%Y.%m.%d my::app::schema::log y_app_schema_log-%Y.%m.%d
The type for the Elasticsearch index to assume. Defaults to 'log'.
A HashRef of valid types for the Elasticsearch index, defaults to just the default_type.
An instance of eris::dictionary configured for the schema. Parameters passed via the dictionary sub section of the config will be used to build the dictionary.
dictionary
A boolean, if true the fields in the document will be filtered by the dictionary element.
A hashref to configure the loading the dictionaries. Defaults to empty.
Boolean, defaults to true. If true this schema "steals" the document and the only one bulk item will be appended to the as_bulk per document. Set to false to indexing the same log into multiple indices.
as_bulk
You'll need to consider the priority of the schema if you set this to false to ensure the schema is early enough in the chain to accept the document.
Boolean, defaults to true. If true only the context hash from the eris::log object is indexed. If set to false, the complete hash is used instead.
complete
Takes an eris::log object and returns the bulk newline delimited JSON to add that object to the cluster.
Takes an eris::log object and returns a hash reference representing that document for indexing.
Takes an eris::log and determines if this schema applies.
eris::log
Returns boolean
Brad Lhotsky <brad@divisionbyzero.net>
This software is Copyright (c) 2015 by Brad Lhotsky.
This is free software, licensed under:
The (three-clause) BSD License
To install eris, copy and paste the appropriate command in to your terminal.
cpanm
cpanm eris
CPAN shell
perl -MCPAN -e shell install eris
For more information on module installation, please visit the detailed CPAN module installation guide.