# Split & Index Issue in Graylog 2.0.4

**URL:** <https://community.graylog.org/t/split-index-issue-in-graylog-2-0-4/3862>\
**Category:** Graylog Central (peer support)\
**Created:** [January 19, 2018, 10:57am UTC](https://community.graylog.org/t/split-index-issue-in-graylog-2-0-4/3862 "2018-01-19T10:57:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fadjer](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/fadjer/32/1722_2.png) [@fadjer](https://community.graylog.org/u/fadjer)\
**Post date:** [January 19, 2018, 10:57am UTC](https://community.graylog.org/t/split-index-issue-in-graylog-2-0-4/3862/1 "2018-01-19T10:57:04Z")

</div>

Hi,

I want to split this string by ‘/’ and get the first element :

/ecm-core/getReferentialNamesYouNeed/flashL/flashP

When I set the ‘Split by’ with / I get a message error. Please check the first image

 ![split1](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/5/5be29510eb82aeff1abe6bd4e225f83770f86bdf.png)

When I escape the /, and setting "Split by’ with /, not split is made. Please check the second image.

 ![split2](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/c/c76c771be31a5b263fddc711b2d32a5e7a78fa3b.png)

What’s the right way to make this simple split ☹ ?

Many Tanks

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [January 19, 2018, 11:40am UTC](https://community.graylog.org/t/split-index-issue-in-graylog-2-0-4/3862/2 "2018-01-19T11:40:40Z")

</div>

It’s pretty unintuitive, but you’re using the wrong target index.

Using `"/"` (not `"\/"`) will split the string “/ecm-core/getReferentialNamesYouNeed” into the following components:

1. “” (empty string, because that’s what is in front of the first split character)
2. “ecm-core”
3. “getReferentialNamesYouNeed”

So you need the target index 2 (“ecm-core”), not 1 (empty string).

---

<div class="post-metadata">

**Author:** ![fadjer](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/fadjer/32/1722_2.png) [@fadjer](https://community.graylog.org/u/fadjer)\
**Post date:** [January 19, 2018, 1:07pm UTC](https://community.graylog.org/t/split-index-issue-in-graylog-2-0-4/3862/3 "2018-01-19T13:07:26Z")

</div>

Thanks. Comparing to java way is really unintuitive as you say 😉 Thanks again

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [February 2, 2018, 1:22pm UTC](https://community.graylog.org/t/split-index-issue-in-graylog-2-0-4/3862/4 "2018-02-02T13:22:43Z")

</div>

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