Hello, I've search for this problem and see it come up pretty often, but the solutions I've found don't seem to take effect for me. Basically, when I create a new index via a logstash config (daily) with a template, it doesn't seem to take effect for those indices. I have manage template set to false. It DOES seem to take effect for other indices that are created by other outputs. I set up the template that specified the geoip.location field to be geo_point, deleted the old index, restarted the cluster and logstash, and then generated new logs to re-create the index. It keeps coming up as showing geoip.location as double. I also tried creating a new index with the template applied, but I get the same result. Anybody have any idea what I'm doing wrong??
my logstash filter config:
if [path] =~ "access_log" {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
if [clientip] {
geoip {
source => "clientip"
database => "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-geoip-0.1.7/vendor/GeoLiteCity-2013-01-18.dat"
}
}
}
and here's the output:
if [path] =~ "access_log" {
elasticsearch {
cluster => "elasticsearchseftest"
manage_template => false
host => "hostname"
index => "sef.test.-%{+YYYY.MM.dd}"
protocol => "http"
user => "luser"
password => "password"
template => "/etc/logstash/conf.d/templates/logstash.json"
template_name => "sef.test.-*"
}
}
This is the template:
{
"template": "sef.test.-*",
"settings": {
"index.refresh_interval": "5s"
},
"mappings": {
"_default_" | {
"_all" : {"enabled" : true},
"dynamic_templates" : [ {
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "analyzed", "omit_norms" : true,
"fields" : {
"raw" : ("type": "string", "index" : "not_analyzed", "ignore_above" : 256}
}
}
}
} ],
"properties" : {
"@version": { "type": "string", "index": "not_analyzed" },
}
"geoip" : {
"type" : "object",
"dynamic" : true,
"properties" : {
"location" : { "type" : "geo_point"}
}
}
}
}
}
Anybody have any idea what I'm doing wrong? I should also note, whenever the index is created, the mapping isn't default but logs, but I have no idea why that's the case