I created the index template file, but it could not apply to the Elasticsearch.
I put the index template file to the $/home/config/templates/japanese_template.json
When I create the index by the logstash which used output plugin "elasticsearch", the index template file could not apply to the index.
could you please let me know What is wrong.
following contents are the index template file.
・index template file
{
"japanese_template":{
"template":"",
"settings":{
"analysis":{
"filter":{
"pos_filter":{
"type":"kuromoji_part_of_speech",
"stoptags":[
"助詞-格助詞-一般",
"助詞-終助詞"
]
},
"greek_lowercase_filter":{
"type":"lowercase",
"language":"greek"
}
},
"tokenizer":{
"kuromoji":{
"type":"kuromoji_tokenizer"
},
"ngram_tokenizer":{
"type":"nGram",
"min_gram":"2",
"max_gram":"3",
"token_chars":[
"letter",
"digit"
]
}
},
"analyzer":{
"kuromoji_analyzer":{
"type":"custom",
"tokenizer":"kuromoji",
"filter":[
"kuromoji_baseform",
"pos_filter",
"greek_lowercase_filter",
"cjk_width"
]
},
"ngram_analyzer":{
"tokenizer":"ngram_tokenizer"
}
}
}
},
"mappings" : {
"default":{
"dynamic_templates":[
{
"string_template":{
"mapping":{
"index":"not_analyzed",
"type":"string"
},
"match_mapping_type":"string",
"match":""
}
}
],
"properties":{
"KJ_ID":{
"type":"integer"
},
"TITLE":{
"type":"string",
"store":"yes",
"index":"analyzed",
"analyzer":"kuromoji_analyzer"
},
"USER_ID":{
"type":"multi_field",
"fields":{
"no_analyzed":{
"index":"not_analyzed",
"type":"string"
},
"analyzed":{
"index":"analyzed",
"type":"string"
}
}
},
"REGIST_DATE_TIME":{
"type":"multi_field",
"fields":{
"no_analyzed":{
"index":"not_analyzed",
"type":"string"
},
"analyzed":{
"index":"analyzed",
"type":"string"
}
}
},
"UPDATE_DATE_TIME":{
"type":"date",
"store":"yes",
"format":"yyyy-MM-dd hh:mm:ss"
},
"UPDATE_FLG":{
"type":"boolean"
}
}
}
}
}
}
and I used the following logstash's config file.
・config file
input {
file {
path => "C:\elastic\logstash-1.5.3\conf\test1.csv"
type => "Kiji"
start_position => "beginning"
}
}
filter {
csv {
columns => ["KJ_ID","TITLE","USER_ID","REGIST_DATE_TIME","UPDATE_DATE_TIME","UPDATE_FLG"]
separator => ","
}
}
output
{
elasticsearch{
action => "index"
host => "localhost"
index => "test1"
protocol => "transport"
cluster => "clustername"
}
}
If you have a solution, please help me.
sincerely