Добрый день.
По началу использовал дефолтный индекс logstash-*, в котором кроме основных полей создавались еще raw поля.
Решил часть данных складывать в отдельный индекс. Почитал доки и вроде бы все настроил как надо, в итоге в еластике имею разбивку на необходимые мне поля, но при этом отсутствуют raw поля которые удобно использовать для дашбоардов.
Мой output конфиг
output {
if [Alert_Analyzer_Name] == "ossec" {
elasticsearch {
hosts => "127.0.0.1:9200"
index => "logstash-%{+YYYY.MM.dd}"
template_overwrite => "true"
}
}
if [type] == "weblog" {
elasticsearch {
hosts => "127.0.0.1:9200"
index => "weblog-%{+YYYY.MM.dd}"
template_overwrite => "true"
}
}
}
curl -XGET localhost:9200/_template/logstash*
{"logstash":{"order":0,"template":"weblog-*","settings":{"index":{"refresh_interval":"5s"}},"mappings":{"_default_":{"dynamic_templates":[{"message_field":{"mapping":{"index":"analyzed","omit_norms":true,"type":"string"},"match_mapping_type":"string","match":"message"}},{"string_fields":{"mapping":{"index":"analyzed","omit_norms":true,"type":"string","fields":{"raw":{"ignore_above":256,"index":"not_analyzed","type":"string"}}},"match_mapping_type":"string","match":"*"}}],"_all":{"omit_norms":true,"enabled":true},"properties":{"geoip":{"dynamic":true,"type":"object","properties":{"location":{"type":"geo_point"}}},"@version":{"index":"not_analyzed","type":"string"}}}},"aliases":{}}}
curl -XGET localhost:9200/_template/weblog*
{"weblog-*":{"order":0,"template":"logstash-*","settings":{"index":{"refresh_interval":"5s"}},"mappings":{"_default_":{"dynamic_templates":[{"message_field":{"mapping":{"index":"analyzed","omit_norms":true,"type":"string"},"match_mapping_type":"string","match":"message"}},{"string_fields":{"mapping":{"index":"analyzed","omit_norms":true,"type":"string","fields":{"raw":{"ignore_above":256,"index":"not_analyzed","type":"string"}}},"match_mapping_type":"string","match":"*"}}],"_all":{"omit_norms":true,"enabled":true},"properties":{"geoip":{"dynamic":true,"type":"object","properties":{"location":{"type":"geo_point"}}},"@version":{"index":"not_analyzed","type":"string"}}}},"aliases":{}},"weblog":{"order":0,"template":"logstash-*","settings":{"index":{"refresh_interval":"5s"}},"mappings":{"_default_":{"dynamic_templates":[{"message_field":{"mapping":{"index":"analyzed","omit_norms":true,"type":"string"},"match_mapping_type":"string","match":"message"}},{"string_fields":{"mapping":{"index":"analyzed","omit_norms":true,"type":"string","fields":{"raw":{"ignore_above":256,"index":"not_analyzed","type":"string"}}},"match_mapping_type":"string","match":"*"}}],"_all":{"omit_norms":true,"enabled":true},"properties":{"geoip":{"dynamic":true,"type":"object","properties":{"location":{"type":"geo_point"}}},"@version":{"index":"not_analyzed","type":"string"}}}},"aliases":{}}}
При этом в logstash-* индексах raw поля присутствуют, а в индекс weblog-* их нет.
Использую логсташ 2.3 и эластик 2.3
Перепробовал кучу рецептов, но ничего не помогло, возможно я чего-то не понимаю.