No. It is not that easy. I need the field in next mutate for further splitting.
see this , you'll understand the intent.
mutate {
split => ["message","Employee"]
add_field => {"part1" =>"%{[message][0]}"} // No need to send this to Output
add_field => {"part2" =>"%{[message][1]}"} // No need to send this to Output
}
mutate {
split => ["part2","#"]
add_field => {"part2_1" =>"%{[part2][0]}"} // No need to send this to Output
add_field => {"part2_2" =>"%{[part2][1]}"} // No need to send this to Output
}
mutate {
split => ["part2_2","="]
add_field => {"X" =>"%{[part2_2][0]}"} // This is required in output
add_field => {"Y" =>"%{[part2_2][1]}"} // This is required in output
}
tell me what change I should do here so that only X , Y goes to output
It is unclear what you want, but you might find it useful to add fields inside [@metadata]. Those are attached to the event, but are not added to the document by the output.
Either way you can test it and if it throws an error, paste here all the details:
log contents used as input
logstash configuration
errors, desired or unexpected output
In fact, if you paste here a sample log line it would be really useful. I presume that, instead of splitting a message in two by a word separator, splitting the result in two again by another word, splitting again by other separators... is a contrieved way to extract the desired information. Maybe grok or kv filters are a simpler solution for your use case.
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.