Soltar mensajes de registro que contienen una cadena específica
Entonces tengo mensajes de registro del formato:
[INFO] <blah.blah> 2016-06-27 21:41:38,263 some text
[INFO] <blah.blah> 2016-06-28 18:41:38,262 some other text
Ahora quiero eliminar todos los registros que no contengan una cadena específica "xyz" y guardar todo el resto. También quiero indexar la marca de tiempo.
grokdebug No está ayudando mucho.
Este es mi intento:
input {
file {
path => "/Users/username/Desktop/validateLogconf/logs/*"
start_position => "beginning"
}
}
filter {
grok {
match => {
"message" => '%{SYSLOG5424SD:loglevel} <%{JAVACLASS:job}> %{GREEDYDATA:content}'
}
}
date {
match => [ "Date", "YYYY-mm-dd HH:mm:ss" ]
locale => en
}
}
output {
stdout {
codec => plain {
charset => "ISO-8859-1"
}
}
elasticsearch {
hosts => "http://localhost:9201"
index => "hello"
}
}
Soy nuevo en grok, por lo que los patrones anteriores pueden no tener sentido. Por favor ayuda.