diff --git a/files/elasticsearch.mapping.json b/files/elasticsearch.mapping.json new file mode 100644 index 0000000..a469881 --- /dev/null +++ b/files/elasticsearch.mapping.json @@ -0,0 +1,19 @@ +{ + "_default_": { + "_all": { "enabled": false }, + "_source": { "compress": true }, + "dynamic_templates": [ + { + "string_template" : { + "match" : "*", + "mapping": { "type": "string", "index": "not_analyzed" }, + "match_mapping_type" : "string" + } + } + ] + "properties" : { + "@fields": { "type": "object", "dynamic": true, "path": "full" }, + "@message" : { "type" : "string", "index" : "analyzed" } + } + } +} diff --git a/manifests/init.pp b/manifests/init.pp index dd5b28e..dbd4914 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -47,6 +47,16 @@ class logstash::elasticsearch { require => Package['elasticsearch'], } + file { '/etc/elasticsearch/default_mapping.json': + ensure => present, + source => 'puppet:///modules/logstash/elasticsearch.mapping.json', + replace => true, + owner => 'root', + group => 'root', + mode => '0644', + require => Package['elasticsearch'], + } + file { '/etc/default/elasticsearch': ensure => present, source => 'puppet:///modules/logstash/elasticsearch.default', @@ -62,6 +72,7 @@ class logstash::elasticsearch { require => Package['elasticsearch'], subscribe => [ File['/etc/elasticsearch/elasticsearch.yml'], + File['/etc/elasticsearch/default_mapping.json'], File['/etc/default/elasticsearch'], ], }