# Logstash skips the last line of build.xml file

**URL:** <https://discuss.elastic.co/t/logstash-skips-the-last-line-of-build-xml-file/131099>\
**Category:** Logstash\
**Created:** [May 9, 2018, 4:42am UTC](https://discuss.elastic.co/t/logstash-skips-the-last-line-of-build-xml-file/131099 "2018-05-09T04:42:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raja\_gopal](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@raja\_gopal](https://discuss.elastic.co/u/raja_gopal)\
**Post date:** [May 9, 2018, 4:42am UTC](https://discuss.elastic.co/t/logstash-skips-the-last-line-of-build-xml-file/131099/1 "2018-05-09T04:42:53Z")

</div>

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"  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![arkady\_renko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arkady_renko/32/30160_2.png) [@arkady\_renko](https://discuss.elastic.co/u/arkady_renko)\
**Post date:** [May 9, 2018, 6:10am UTC](https://discuss.elastic.co/t/logstash-skips-the-last-line-of-build-xml-file/131099/2 "2018-05-09T06:10:53Z")

</div>

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

> [@Filebeat - multiline: Ingest XML's without line feed at end of file](https://discuss.elastic.co/t/filebeat-multiline-ingest-xmls-without-line-feed-at-end-of-file/99021/7):
>
> Resolution for me was to write a script that puts a line feed at the end of each XML. Not pretty, but it works.

---

<div class="post-metadata">

**Author:** ![raja\_gopal](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@raja\_gopal](https://discuss.elastic.co/u/raja_gopal)\
**Post date:** [May 11, 2018, 9:30am UTC](https://discuss.elastic.co/t/logstash-skips-the-last-line-of-build-xml-file/131099/3 "2018-05-11T09:30:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 8, 2018, 9:31am UTC](https://discuss.elastic.co/t/logstash-skips-the-last-line-of-build-xml-file/131099/4 "2018-06-08T09:31:59Z")

</div>

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