i tried this \s%{WORD:data1}\s+%{WORD:data2} and it did not work correctly .
i tried this \s+%{WORD:data1}\s+%{WORD:data2} it works for this follows example:
Hello World
i noticed that \s+%{WORD:data1}\s+%{WORD:data2} can read the first empty line in my text editor and than some whiteSpaces until the "Hello" and the second \s+ let me just add one whitespace between each other word nothing else.
it does not allowed me to jump to next empty Line , or to read the Example above .
i need to read the Example above correctly with all whitespaces , and all empty Lines.
Can you please help me , i even tried with this
match => { "message" => "\s+%{WORD:data1}\s+\r%{WORD:data2}"}
in order to try to jump to next empty Line.
i tried this too
match => { "message" => "\s+%{WORD:data1}\s+\n%{WORD:data2}"}
Nothing works until now.
Hi Ganesh2303:
i tried your
\s%{WORD:data1}\s+%{WORD:data2}
and it did not work correctly.
it could not read empty Line or jump into after empty Line with Whitespaces.
with this:
\s+%{WORD:data1}\s+%{WORD:data2}
i could read just
Hello World
i need to let logstash jump after the empty Line and get the rest of my above example "Hello back" .
as soon as Logstash see an empty Line after "Hello World" , it will return nothing after that.
That is the Issue.
Do you have any suggestion?
i did not understand correctly what you meant with "2 Lines are single message" ?
i need to let Logstash read my "Hello back", that means after reading the "Hello World" , it has to jump after any empty Line he sees and get the Rest "Hello Back".
Logstash is line to line read process, if your message is single line no issues but if you want to process 1 or 2 line message we need to configure according to that message.
Sorry for Late answer, cause this tool here blocked me for 20 Hour cause of reaching my maximum text level. so i am just able to modify my old Comments in order to ask for help.
i tried to put drop Command like follows, but still could not read the Example above correctly,
any Suggestions.
filter {
if [message] =~ /^\s*$/ {
drop { }
}
grok {match => { "message" => "\s%{WORD:data1}\s+%{WORD:data2}\n\s+%{WORD:data3}\s%{WORD:data4}"}
}
}
Use your drop filter first and then use filter condition, because intially your filter works first and then only it will goes for drop condition as per your configuration.
Hello Ganesh33, sorry for late Response,
so i did do what you said about drop Command at Beginning of my filter,
filter {
if [message] =~ /^\s*$/ {
drop { }
}
grok {match => { "message" => "\s%{WORD:data1}\s+%{WORD:data2}\n\s+%{WORD:data3}\s%{WORD:data4}"}
}
}
it is still does not work to tell Logstash to jump over an empty Line , and jump the whitespaces until reach the "Hello Back" sentence and read it. as you can see in the above Picture.
the "\n\s" did not do anything to let Logstash reach the "Hello Back" sentence.
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.