# Parsing xml message inside json file

**URL:** https://discuss.elastic.co/t/parsing-xml-message-inside-json-file/189100
**Category:** Logstash
**Created:** [July 5, 2019, 12:46pm UTC](https://discuss.elastic.co/t/parsing-xml-message-inside-json-file/189100 "2019-07-05T12:46:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![saisimo02](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@saisimo02](https://discuss.elastic.co/u/saisimo02)
#### Post date: [July 5, 2019, 12:46pm UTC](https://discuss.elastic.co/t/parsing-xml-message-inside-json-file/189100/1 "2019-07-05T12:46:22Z")

</div>

Hello,

I am getting an error while filtering a json file. Previously, I was using filebeat to send data directly to logstash, but now I am using kafka between filebeat and logstash. So the output is not the same:

Previously, the input of my logstash was a part of an xml.

Example: ![kibana](https://us1.discourse-cdn.com/elastic/original/3X/7/5/75cdd56f018ddf45d32d0063646bd4b9941e0f88.png)

And now I am getting a json file:  
 ![json_kibana](https://us1.discourse-cdn.com/elastic/original/3X/c/d/cdf9b60fd368be09d35b4b4a78994277c30fe5a9.png)

inside this json file, I can find the part of xml I was using before (message in yellow)

How can I change this part of my logstash to will be able to filter the xml file like I was doing before.

the first part of my filter was:  
 ![old_logstash](https://us1.discourse-cdn.com/elastic/original/3X/2/7/27c6986778e23db8fea7682f605e1368938c24eb.png)

I tried to use something like that but I am getting errors:

 ![logstash](https://us1.discourse-cdn.com/elastic/original/3X/0/8/089cb7036b33874c5ccc12db58fbf7f45dd2b38b.png)

Thank you for your help

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [July 5, 2019, 3:29pm UTC](https://discuss.elastic.co/t/parsing-xml-message-inside-json-file/189100/2 "2019-07-05T15:29:26Z")

</div>

> [@saisimo02](#):
>
> I am getting an error while filtering a json file.

What error are you getting? Also, please do not post pictures of text, just post the text.

---

<div class="post-metadata">

### Author: ![saisimo02](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@saisimo02](https://discuss.elastic.co/u/saisimo02)
#### Post date: [July 8, 2019, 7:29am UTC](https://discuss.elastic.co/t/parsing-xml-message-inside-json-file/189100/3 "2019-07-08T07:29:32Z")

</div>

I am getting this error:

```
[WARN][logstash.filters.split] Only String and Array types are splittable. field:[theXML][measType] is of type = NilClass
```

---

<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: [August 5, 2019, 7:29am UTC](https://discuss.elastic.co/t/parsing-xml-message-inside-json-file/189100/4 "2019-08-05T07:29:33Z")

</div>

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