# Fetching substring from a string in kibana

**URL:** <https://discuss.elastic.co/t/fetching-substring-from-a-string-in-kibana/338203>\
**Category:** Kibana\
**Created:** [July 12, 2023, 10:33am UTC](https://discuss.elastic.co/t/fetching-substring-from-a-string-in-kibana/338203 "2023-07-12T10:33:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [July 12, 2023, 8:38pm UTC](https://discuss.elastic.co/t/fetching-substring-from-a-string-in-kibana/338203/2 "2023-07-12T20:38:07Z")

</div>

Hi, I think you want to try the "mutate" filter to split the URL field and store part of the splitted result into a new field. Here's an example that might help:

```auto
filter {
  mutate {
    split => ["url", "/"]
    add_field => { "service_name" => "%{[url][1]}" }
  }
}

```

I haven't tried this and this could contain errors. If you need more help, you might want to ask this question in the Logstash area of this forum: [https://discuss.elastic.co/c/elastic-stack/logstash/14](https://discuss.elastic.co/c/elastic-stack/logstash/14)

---

_[View the full topic](https://discuss.elastic.co/t/fetching-substring-from-a-string-in-kibana/338203)._
