# How to get string from path

**URL:** https://discuss.elastic.co/t/how-to-get-string-from-path/242156
**Category:** Logstash
**Created:** [July 22, 2020, 8:59am UTC](https://discuss.elastic.co/t/how-to-get-string-from-path/242156 "2020-07-22T08:59:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Champion\_Xie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/champion_xie/32/71770_2.png) [@Champion\_Xie](https://discuss.elastic.co/u/Champion_Xie)
#### Post date: [July 22, 2020, 8:59am UTC](https://discuss.elastic.co/t/how-to-get-string-from-path/242156/1 "2020-07-22T08:59:50Z")

</div>

hi all,

My application log file name format is room1\_num\_perf.log, i want get the string 'room1' ,and then the string as a new field into ES

---

<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 19, 2020, 8:59am UTC](https://discuss.elastic.co/t/how-to-get-string-from-path/242156/2 "2020-08-19T08:59:53Z")

</div>

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