# Filter XML plugin namespace available?

**URL:** <https://discuss.elastic.co/t/filter-xml-plugin-namespace-available/314463>\
**Category:** Logstash\
**Created:** [September 14, 2022, 9:37pm UTC](https://discuss.elastic.co/t/filter-xml-plugin-namespace-available/314463 "2022-09-14T21:37:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erwin339](https://avatars.discourse-cdn.com/v4/letter/e/2bfe46/32.png) [@erwin339](https://discuss.elastic.co/u/erwin339)\
**Post date:** [September 14, 2022, 9:37pm UTC](https://discuss.elastic.co/t/filter-xml-plugin-namespace-available/314463/1 "2022-09-14T21:37:30Z")

</div>

When using the namespace =\> { or the remove\_namespace I don't get any positive response when wanting to assign or remove the namespace, since I am getting this error  
Error parsing xml with XmlSimple  
\<REXML::UndefinedNamespaceException: Undefined prefix log4j found\>  
I'm new and I don't know if I'm using the xml correctly

MY LOG:

```auto
<log4j:event logger="LogGeneratorApp.MainForm" timestamp="1662748734048" level="INFO" thread="1">log4j:messageThis is a test log message</log4j:message>log4j:properties<log4j:data name="log4net:UserName" value="TE\60085367" /><log4j:data name="log4jmachinename" value="TAMP00043541" /><log4j:data name="log4japp" value="LogGeneratorApp.exe" /><log4j:data name="log4net:HostName" value="TAMP00043541" /></log4j:properties><log4j:locationInfo class="LogGeneratorApp.MainForm" method="SendToLog" file="" line="0" /></log4j:event>

```

MY Filter LOGSTASH.CONF

```auto

filter{
xml{
source => "message"
target => "doc"
xpath => ["/log4j:event/log4j:message/text()","messageM"]
namespaces => {"log4j" => "http://jakarta.apache.org/log4j/"}
#remove_namespaces => false
#store_xml => false
}
}

```

A solution for this problem that I found is to make use of:  
`filter { mutate { gsub => ['message', 'values to modify','value modified'] }}`

---

<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:** [October 12, 2022, 9:37pm UTC](https://discuss.elastic.co/t/filter-xml-plugin-namespace-available/314463/2 "2022-10-12T21:37:33Z")

</div>

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