Count the number of newlines and add 1. No fancy escaping schemes in logstash, just embed a literal newline in the string...
ruby { code => 'event.set("numLines", 1 + event.get("message").count("
"))' }
Count the number of newlines and add 1. No fancy escaping schemes in logstash, just embed a literal newline in the string...
ruby { code => 'event.set("numLines", 1 + event.get("message").count("
"))' }
© 2020. All Rights Reserved - Elasticsearch
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.