Logstash skips the last line of build.xml file

Hello All,

I am trying to read build.xml file from my jenkins server into elasticsearch through logstash. I have used file input plugin along with multiline codec but what happens is logstash does not read the xml line fully, instead it skips the last line () of the xml file.
I am posting the code as well as contents of the xml file, could someone please help me ?
and content of the xml file is

  • <?xml version='1.0' encoding='UTF-8'?>
  • <build>
    
  •   <actions>
    
  • </actions>
    
  •   <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
    
  • </build>
    

    input {
    file {
    path => "/var/lib/jenkins/jobs/test_logstash/builds/lastSuccessfulBuild/build.xml"
    type => "jenkinslog"
    codec => multiline {
    pattern => ">$"
    what => "previous"
    }
    }
    }

Similar problem with filebeat. Workaround is adding line feed to last line.

Thanks but still is there any way to fix this within "file" input plugin ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.