# Using the Split filter with a dynamic field

**URL:** https://discuss.elastic.co/t/using-the-split-filter-with-a-dynamic-field/57247
**Category:** Logstash
**Created:** [August 4, 2016, 4:04pm UTC](https://discuss.elastic.co/t/using-the-split-filter-with-a-dynamic-field/57247 "2016-08-04T16:04:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![3ygun](https://avatars.discourse-cdn.com/v4/letter/3/67e7ee/32.png) [@3ygun](https://discuss.elastic.co/u/3ygun)
#### Post date: [August 4, 2016, 4:04pm UTC](https://discuss.elastic.co/t/using-the-split-filter-with-a-dynamic-field/57247/1 "2016-08-04T16:04:35Z")

</div>

## Question

Can you use the `split` filter with a dynamic field (`"%{some_field}"`)?

## Problem

The documentation doesn't say ([Split filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-split.html)) and the intuitive `split { field => "%{test}" }` doesn't seem to work. Test case below:

### Test Case:

```auto
{"test":"bar","bar":[{"m":"hello"},{"m":"world"}]}

```

### Logstash conf file:

```auto
input {
  stdin {
    codec => json
  }
}

filter {
  split {
    field => "%{test}"
  }
}

output {
  stdout { codec => rubydebug { metadata => true } }
}

```

### Error when running:

![](https://us1.discourse-cdn.com/elastic/original/2X/e/e0a6929d585254fb4b332d95d507793a8a6d5324.PNG)

---

<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: [July 6, 2017, 4:44am UTC](https://discuss.elastic.co/t/using-the-split-filter-with-a-dynamic-field/57247/2 "2017-07-06T04:44:27Z")

</div>


