Hi Team,
I have a message field with multiline i.e
Exception in thread "main" java.lang.IllegalStateException: A book has a null property\n\tat com.example.myproject.Author.getBookIds(Author.java:38)
\n\tat com.example.myproject.Bootstrap.main(Bootstrap.java:14)\nCaused by: java.lang.NullPointerException\n\tat com.example.myproject.Book.getId(Book.java:22)\n\tat com.example.myproject.Author.getBookIds(Author.java:35)
In this message there are 6 lines
I used following ruby code in logstash filter
ruby {
code => 'event.set("numLines", 1 + event.get("message").count("\n"))'
}
This giving count as '1' not the actual number of lines.
Please, Can anyone help me!