The messages does not contain %{host} when using json codec in kafka output plugin or when using stdout { codec => rubydebug }, but I dont want to use the json codec, I just want to keep the xml format from sqs to kafka, and I want logstash not to add the %{host} field, any suggestions ?
To actually edit the XML, well that is hard because we don't have an xml codec.
If we did, then the workflow would be decode xml at the input -> add fields to the event -> encode xml at the output.
I think you will have to experiment with mutate gsub
e.g.
NOTE: It will be hard to get the indentation and newlines to look "pretty" but if its important you can try but it will be valid xml if you don't.
The second argument in the gsub array is a regex so you need to follow the regex escaping rules, e.g. if you wanted to say add the new elements after the closing tag </NotificationType> then the regex wold need to escape the forward slash - <\/NotificationType>
Like so:
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.