# How to parse space with xpath in logstash

**URL:** <https://discuss.elastic.co/t/how-to-parse-space-with-xpath-in-logstash/142465>\
**Category:** Logstash\
**Created:** [August 1, 2018, 5:32am UTC](https://discuss.elastic.co/t/how-to-parse-space-with-xpath-in-logstash/142465 "2018-08-01T05:32:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aristarkh\_Bushkov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aristarkh_bushkov/32/45475_2.png) [@Aristarkh\_Bushkov](https://discuss.elastic.co/u/Aristarkh_Bushkov)\
**Post date:** [August 1, 2018, 5:32am UTC](https://discuss.elastic.co/t/how-to-parse-space-with-xpath-in-logstash/142465/1 "2018-08-01T05:32:30Z")

</div>

Hi everyone. I try to parse space with xpath in logstash. My code works, but when this condition "//_/Sql\_Text[text()[contains(.,'DROP'' '') or contains(.,'CREATE'\s'') see CREATED or DROPED it take it and i need to add single space after DROP,CREATE...  
input {  
beats {  
port =\> 5044  
}  
}  
filter {  
xml {  
remove\_namespaces =\> "true"  
store\_xml =\> "false"  
source =\> "message"  
xpath =\> [  
"//_/Sql\_Text[text()[contains(.,'DROP'' '') or contains(.,'CREATE\s') or contains(.,'ALTER')]]/text()","SQL\_TEXT"  
]  
}

---

<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 29, 2018, 5:32am UTC](https://discuss.elastic.co/t/how-to-parse-space-with-xpath-in-logstash/142465/2 "2018-08-29T05:32:34Z")

</div>

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