Elasticsearch Split Processor preserve_trailing value

Hi,

I have the follwing message and try to to split values and remove at the same time the empty value with preserve_trailing:

                          Members[
                                  xxx.xxx.xxx.xxx:xxxx
                                  xxx.xxx.xxx.xxx:xxxx
                                  xxx.xxx.xxx.xxx:xxxx
                                  xxx.xxx.xxx.xxx:xxxx
                                  xxx.xxx.xxx.xxx:xxxx
                                  xxx.xxx.xxx.xxx:xxxx

If I enable preserve_trailing :


    {
      "split": {
        "field": "members_list",
        "separator": "\\n+\\s+",
        "preserve_trailing": true,
        "description": "Generate Values"
      }
    },

Expected result is:

          "members_list" : [
            "",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
            ""
          ],

If I turn off preserve_trailing I fallowing seeing empty value lines between another (first line in my case).

          "members_list" : [
            "",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
            "xxx.xxx.xxx.xxx:xxxx",
          ],

There are form to remove this empty lines, the first one in my example?

Thank you very much,

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