We are having issues with our syntax writing, where we try to extract a length of numbers from a long string that continues on both ends of the wanted piece of numbers. Our theory is that the problem lies within our use of %{GREEDYDATA} to separate the string. We have tried substituting %{GREEDYDATA} for %{NUMBER} with the same result; a _grokparsefailure. The string we are handling is already parsed, does that have to do with it? Any thoughts?
grok {
match => { "[doc][Message]" => "%{GREEDYDATA:Bloat} Case: %{GREEDYDATA:Case}"}
}
mutate {
add_field => [ "CommandID", "%{[doc][Message][1]}" ]
}
if ("CloseND" in [CommandID]) {
grok {
match => { "Bloat" => "%{GREEDYDATA:Bloat2}Time (ms): %{GREEDYDATA:SessionLength}"}
}
}
We receive CommandID from elsewere with no issues.
If the CommandID is CloseND we want to grokparse the Time (ms): from Bloat, preferably as a number and not a string if it doesn't have a significant impact on performance.
We split [doc][Message] into an array after the first grok match. The case is not always at the same array index so we want to extract it before splicing [doc][Message]. And after that we want to match Time (ms) only if the CommandID is CloseND so we try to take it from the Bloat field we make after the first grok match and splice, which we do to compare and extract CommandID.
We can include the whole config if you want to see it.
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.