I have more than one type of document per file.
I want to set them apart with different types.
This topic lead me to writing :
replace => { "type" => "%{log_type}"}
"log_type" was added in grok and separates names few events.
What I get is:
a warning
[2017-12-01T09:52:28,089][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"logstash-2017.12.01", :_type=>"My_log_type", :_routing=>nil}, #LogStash::Event:0x5acfcebf], :response=>{"index"=>{"_index"=>"logstash-2017.12.01", "_type"=>"My_log_type", "_id"=>"z7Z9EWABqNc_5GGY1bF0", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [logstash-2017.12.01] as the final mapping would have more than 1 type: [%{log_type}, My_log_type]"}}}}
And in elastic my event has _type and type "%{log_type}" as an actual value.
That depends on y our data. If you do not have any mapping conflicts, you can store it all in one index. If you have mapping conflicts you may need to split data into multiple indices.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.