for each session id ( 0x0x167892507c74d32 ) there are multiple watches (/zookeeper/cluster_name/stores/xx/xxxx )listed below, each starting with a few spaces, and I wish to split this single event into multiple events, each with the following fields:
I'm aware there is a "split" plugin in logstash which could help, but I don't know how to do it ,could anyone please offer a simple example of how to do this? any suggestion would be greatly appreciated!
I don't think split is the filter you should be looking to use here.
You may have to use an aggregate or multiline plugin instead that uses the session id as the start event and then you can a timeout for the last event.
The end results would be a single event but it would contain the session id and all of the corresponding watches for that session id.
Then I used mutate-gsub to replace "\n" to "," for the latter mutate-split,and to remove all spaces in the "watch" field, after mutate-split the event is like:
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.