Hi,
I am new to ELK.
I am trying to parse jenkins build.xml and collecting output using elastic search.
I am using codec => multiline for the input to get it as a single event but i could not able to get tag in the message.
When you post preformatted code, please use the preformatted text button to ensure the forums don't mess with it, there's an icon that looks like </>, just highlight your text and click that button, helps in understanding what you paste in.
As far as the issue, I'm not quite sure how it processes the what action next...does it stick it at the beginning of the line or at the end? Regardless, have you tried setting your pattern to <build> and then what to previous? Seems like it would give you something like below.
Afterwards, you could use an if expression with the drop filter to get rid of the xml versioning/encoding line from the event. For the problem with the end tag missing, add the multiline codec option auto_flush_interval
Thank you very much for u r answer.
I changed my logstash.conf file to below. even now i am getting the output as same as above.
even i tried with pattern and still i am not getting the end tag
input {
file {
path => "/var/lib/jenkins/jobs/PackageJob/builds/7/build.xml"
sincedb_path => "/dev/null"
start_position => "beginning"
type => "buildxml"
Note: Still I am unable to get tag in the message. Please help me how to get that last tag. and even i changed what==> previous and auto_flush_interval =>3 seconds.
blah...not sure why I didn't see this earlier. You aren't using the XML filter to parse the data so it's ingesting the file, the multiline codec is sticking it all together onto a single line, and then it's being output to Elasticsearch. In the filter section you need to do a couple things, this example is not all inclusive or functional, you'll need to read the Logstash XML plugin filter documentation and learn some xpath basics to tailor it to your needs:
Note: Still I am unable to get tag in the message. Please help me how to get that last tag. and even i changed what==> previous and auto_flush_interval =>3 seconds.
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.