immfly / elastic-mapper

Library and Toolkit to easily export metrics to ES and manage templates and mappings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

elastic-mapper

Library and Toolkit to easily export metrics to ES and manage templates and mappings

Example:

class TestTemplate(Template):
    name = "test_template"
    template = "test-*"
    
    class Meta:
    	# settings
        number_of_shards = 1


class NestedMapper(Mapper):
    nested_string = StringField()
    nested_int_with_source = IntegerField(source='nested_int_field')


@register('test_type', TestTemplate)
class TestMapper(Mapper):
    string_field = StringField()
    int_field = IntegerField()
    string_field_with_source = StringField(source='another_attr')
    method_field = StringField(source='mapper__get_test_method_field')
    nested_field = NestedMapper()

    def get_test_method_field(self, obj):
    	return "test method string"

About

Library and Toolkit to easily export metrics to ES and manage templates and mappings


Languages

Language:Python 98.0%Language:Shell 2.0%