Articles index:
- Introduction (Everyone)
- JSON as logs format (Everyone)
- Logging best practices with Logback (Targetting Java DEVs)
- Logging cutting-edge practices (Targetting Java DEVs)
- Contract first log generator (Targetting Java DEVs)
- ElasticSearch VRR Estimation Strategy (Targetting OPS)
- VRR Java + Logback configuration (Targetting OPS)
- VRR FileBeat configuration (Targetting OPS)
- VRR Logstash configuration and Index templates (Targetting OPS)
- VRR Curator configuration (Targetting OPS)
- Logstash Grok, JSON Filter and JSON Input performance comparison (Targetting OPS)
VRR Logstash configuration and Index templates
Logstash configuration from example can be found here.input { beats { port => 5044 codec => json } } output { if [fields][logschema] == "vrr" { //for ALL VRR applications if [importance] == "CRIT" { //for ALL CRITICAL LINES elasticsearch { //send to SERVICE-LOGSCHEMA-IMP-DATE index (vrr-loggingup-crit-2018-09-10) with template template.max hosts => "localhost:9200" index => "
vrr-
%{[fields][service]}-crit-%{+YYYY-MM-dd}" //ONE INDEX PER APPLICATION AND DAY AND IMPORTANCE template => "/path/to/templates/template-max.json" //USING THIS TEMPLATE, NEXT CHAPTER! template_overwrite => true template_name => "vrr-max" } } else if [importance] == "IMP" {
//for ALL CRITICAL LINES
elasticsearch {
//send to SERVICE-LOGSCHEMA-IMP-DATE index (vrr-loggingup-imp-2018-09-10) with template template.mid
hosts => "localhost:9200" index => "
"
vrr-
%{[fields][service]}-imp-%{+YYYY-MM-dd}
//ONE INDEX PER APPLICATION AND DAY AND IMPORTANCE
template => "/path/to/templates/template-mid.json"
//USING THIS TEMPLATE, NEXT CHAPTER!
template_overwrite => true template_name => "vrr-mid" } } else { //FOR BOTH "LOW" AND NO-EXPLICIT TAGGING elasticsearch {
hosts => "localhost:9200" index => "
//send to SERVICE-LOGSCHEMA-IMP-DATE index (vrr-loggingup-low-2018-09-10) with template template.min
"
vrr-
%{[fields][service]}-low-%{+YYYY-MM-dd}
//ONE INDEX PER APPLICATION AND DAY AND IMPORTANCE
template => "/path/to/templates/template-min.json"
//USING THIS TEMPLATE, NEXT CHAPTER!
template_overwrite => true template_name => "vrr-min" } } } else
{ //OTHER NON-VRR APPLICATIONS elasticsearch { hosts => "localhost:9200" index => "logstash-classic-
%{[fields][service]}
}
-%{+YYYY-MM-dd-HH}
" //STILL ONE SEPARATE INDEX PER APPLICATION AND DAY } }
Template template-max.json (here)
{
"index_patterns": ["vrr-*-crit-*"], //FOR ALL INDICES THAT MATCH THIS EXPRESSION
"order" : 1,
<- Overrides order 0 settings (default values like number of shards or mappings)
"settings": {
"number_of_replicas": 2 //WE WANT 2 EXTRA COPIES + MASTER
}
}
Template template-mid.json (here)
{
"index_patterns": ["vrr-*-imp-*"], //FOR ALL INDICES THAT MATCH THIS EXPRESSION
"order" : 1,
<- Overrides order 0 settings (default values like number of shards or mappings)
"settings": {
"number_of_replicas": 1 //WE WANT AN EXTRA COPY + MASTER
}
}
Template template-min.json (here)
{
"index_patterns": ["vrr-*-low-*"], //FOR ALL INDICES THAT MATCH THIS EXPRESSION
"order" : 1, <- Overrides order 0 settings (default values like number of shards or mappings)
"settings": {
"number_of_replicas": 0 //WE DON'T WANT EXTRA COPIES, JUST MASTER
}
}
Next: 10 - VRR Curator configuration
No hay comentarios:
Publicar un comentario
Nota: solo los miembros de este blog pueden publicar comentarios.