Hi Team,
I am trying to do thread dumb analysis using logstash. I want to read number of line available in the message filed using logstash code and create a pie chart based on line count.
Please let me know how to count lines.
Thanks in Advance.
Hi Team,
I am trying to do thread dumb analysis using logstash. I want to read number of line available in the message filed using logstash code and create a pie chart based on line count.
Please let me know how to count lines.
Thanks in Advance.
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("
"))' }
Thanks . It worked.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 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.