Answer the question
In order to leave comments, you need to log in
How to load index template in elasticsearch?
good afternoon.
The logstash config has the following input and output:
input{
redis {
host => "xxxx"
port => 21345
data_type => "list"
key => "test"
threads => 16
type => "223ab-xyz"
}
}
output {
elasticsearch {
hosts => "example. com:80"
index => "223ab-xyz-%{+YYYY.MM}"
template => "/opt/logstash/custom_patterns/elasticsearch-template_223.json"
template_name => "223"
user =>"elastic"
password => "changeme"
}
}
{
"template" : "223ab-*",
"settings" : {
"index": {
"refresh_interval": "-1",
"number_of_shards": "4",
"number_of_replicas": "0",
"translog": {
"flush_threshold_size": "512mb"
}
}
},
"mappings" : {
"_default_" : {
"_all" : {"enabled" : true, "omit_norms" : true},
"dynamic_templates" : [ {
"message_field" : {
"match" : "message",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "analyzed", "omit_norms" : true,
"fielddata" : { "format" : "disabled" }
}
}
}, {
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string ", "index" : "analyzed", "omit_norms" : true,
"fielddata" : { "format" : "disabled" },
"fields" : {
"raw" : {"type": "string", "index " : "not_analyzed", "ignore_above" :256}
}
}
}
} ],
"properties" : {
"@timestamp": { "type": "date" },
"@version": { "type": "string", "index": "not_analyzed" },
"geoip" : {
"dynamic": true,
"properties" : {
"ip": { "type": "ip " },
"location" : { "type" : "geo_point" },
"latitude" : { "type" : "float" },
"longitude" : { "type" : "float" }
}
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question