Como guardan logstash y elasticsearch

Buenas tardes. Como dice el asunto tengo mis dudas de como y donde guardan tanto logstash como elasticsearch. Mi caso en particular es que quiero volver a procesar logs que no quedaron parseados correctamente.

Gracias.
Saludos,
Cristian

si entiendo cierto, espanol no es mi primera lingua, tu quieres procesar logs outra vez si no parseio correctamente. Primeira necessita entiendar porque nao estan parsando correcto y corrigir isso. Asi no necessitas volver a procesar logs porque estan parseado correcto a primera vez.

Bien, ahora para atender sua pergunta... puedes hacer algo asi en output:

output{
if _grokparsefailure in [tags]{
file{
path=/path/to/a/dir/parsefailure.log
}
}
else{
que ya tienes en output aqui
}
}

asi puedes tambien adicionar outro input que esta leendo este file, mas puedes ser peligroso porque casi certamente encontraria un loop infinito si no hace algo para avitar isso. algo como:

input{
file{
path=> /path/to/your/grokparsefailure.log
add_tag => "finalerror"
}
}

y en el output:
if "finalerror" in [tags]{
}
if "_grokparsefailure" in [tags]{
file{
path=/path/to/a/dir/parsefailure.log
}
}
else{
que ya tienes en output aqui
}
}

nunca tentei algo asi, y no es una buena ideia. Preferida seria disobrir porque no esta parseando correcto y corrigir el grok.
http://grokdebug.herokuapp.com/

in english:
If i understand correctly, you want to reprocess logs that didnt parse correct the first time. First you should understand why they are parsing and correct this. This way it isn't necessary to reprocess logs because they parsed correctly the first time.

Now to answer your question...
code references

Like this you can add another input that reads the file you just created, but this can be dangerous because you will certainly create an infinite loop unless you code to avoid that. Something like:
more code references

I have never tried the above, and I dont think its a good idea. Preferable would be to find out why it is not parsing to begin with and correct the grok statements.

1 Like