# Is this expected behaviour of split processor in a pipeline?

**URL:** https://discuss.elastic.co/t/is-this-expected-behaviour-of-split-processor-in-a-pipeline/204754
**Category:** Elasticsearch
**Created:** [October 23, 2019, 4:29am UTC](https://discuss.elastic.co/t/is-this-expected-behaviour-of-split-processor-in-a-pipeline/204754 "2019-10-23T04:29:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pk.241011](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pk.241011/32/86285_2.png) [@pk.241011](https://discuss.elastic.co/u/pk.241011)
#### Post date: [October 23, 2019, 4:29am UTC](https://discuss.elastic.co/t/is-this-expected-behaviour-of-split-processor-in-a-pipeline/204754/1 "2019-10-23T04:29:14Z")

</div>

I am on ES 7.2.0

I create a simple pipeline:

```
PUT _ingest/pipeline/test_pipeline
{
  "description": "test",
  "processors": [
    {
      "split": {
        "field": "message",
        "target_field": "splitdata",
        "separator": ","
      }
    }
  ]
}

```

Then I test it.

```
GET _ingest/pipeline/test_pipeline/_simulate
{
  "docs": [
    {
      "_source" :{
        "message" : "A,,B,,"
      }
    }
  ]
}

```

Results come back like this:

```
{
  "docs" : [
    {
      "doc" : {
        "_index" : "_index",
        "_type" : "_doc",
        "_id" : "_id",
        "_source" : {
          "message" : "A,,B,,",
          "splitdata" : [
            "A",
            "",
            "B"
          ]
        },
        "_ingest" : {
          "timestamp" : "2019-10-23T04:25:26.277Z"
        }
      }
    }
  ]
}

```

I was expecting two empty fields after the character 'B'.

With an input like this:

```
GET _ingest/pipeline/test_pipeline/_simulate
{
  "docs": [
    {
      "_source" :{
        "message" : "A,,B,,C"
      }
    }
  ]
}

```

I get the expected fields.

```
{
  "docs" : [
    {
      "doc" : {
        "_index" : "_index",
        "_type" : "_doc",
        "_id" : "_id",
        "_source" : {
          "message" : "A,,B,,C",
          "splitdata" : [
            "A",
            "",
            "B",
            "",
            "C"
          ]
        },
        "_ingest" : {
          "timestamp" : "2019-10-23T04:27:38.400Z"
        }
      }
    }
  ]
}

```

Edit: Not very hopeful [now](https://stackoverflow.com/questions/14602062/java-string-split-removed-empty-values).

---

<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: [November 20, 2019, 4:29am UTC](https://discuss.elastic.co/t/is-this-expected-behaviour-of-split-processor-in-a-pipeline/204754/2 "2019-11-20T04:29:26Z")

</div>

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