elasticsearch 是否可以在logstash中为索引设置自定义映射,但不能在elasticsearch中设置?
在Logstash主编码中有输入、过滤和输出 是否可以在中设置自定义映射elasticsearch 是否可以在logstash中为索引设置自定义映射,但不能在elasticsearch中设置?,elasticsearch,mapping,output,logstash,elasticsearch,Mapping,Output,Logstash,在Logstash主编码中有输入、过滤和输出 是否可以在中设置自定义映射 output { elasticsearch { } 如果可能,我如何设置它? 在这个例子中: "mappings" : { "_default_" : { "properties" : { "service" : { "type" : "integer" }, "rule" : { "type" : "integer" }, "ICMP Type" : { "type" : "integer
output
{ elasticsearch {
}
如果可能,我如何设置它?
在这个例子中:
"mappings" : {
"_default_" : {
"properties" : {
"service" : { "type" : "integer" },
"rule" : { "type" : "integer" },
"ICMP Type" : { "type" : "integer" },
"ICMP Code" : { "type" : "integer" },
"ip_offset" : { "type" : "integer" },
"ip_id" : { "type" : "integer" },
"ip_len" : { "type" : "integer" },
"Confidence Level" : { "type" : "integer" },
"fragments_dropped" : { "type" : "integer" },
"Severity" : { "type" : "integer" },
"serial_num" : { "type" : "integer" },
"during_sec" : { "type" : "integer" },
"Attack info" : {"type": "string", "index" : "not_analyzed" },
"peer gateway" : {"type": "string", "index" : "not_analyzed" }
Logstash附带一个默认模板,在将文档写入elasticsearch时使用该模板 如果要更改默认设置,可以更新配置并将模板文件的位置传递给它
您可以使用模板和模板覆盖字段,如下所示:
elasticsearch {
template => "/tttttttttttt/elasticsearch-logstash-template.json"
index => "logstash-%{+YYYY.MM.dd}"
cluster=>"cluster"
template_overwrite => true
}