# Logstash kv field\_split regex

**URL:** <https://discuss.elastic.co/t/logstash-kv-field-split-regex/264058>\
**Category:** Logstash\
**Created:** [February 11, 2021, 9:56pm UTC](https://discuss.elastic.co/t/logstash-kv-field-split-regex/264058 "2021-02-11T21:56:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![newmember](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@newmember](https://discuss.elastic.co/u/newmember)\
**Post date:** [February 11, 2021, 9:56pm UTC](https://discuss.elastic.co/t/logstash-kv-field-split-regex/264058/1 "2021-02-11T21:56:40Z")

</div>

I am using logstash 2.4.0 for business reasons.  
Does the field\_split split on each of these characters:  
(,\r,\n,|,\n,),\t  
OR using regex does the split recognize the OR option in the brackets?  
(\r\n|\n)\t

```auto
	kv {
       source => "server_event_message"
       field_split => "(\r\n|\n)\t"
       value_split => "\t{1}"
	   include_brackets => false
	   trim => "'\r\n\t"
	   trimkey => "<>\[\],\(\)=\s:\?\r\n\t"
	}

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 12, 2021, 1:08am UTC](https://discuss.elastic.co/t/logstash-kv-field-split-regex/264058/2 "2021-02-12T01:08:24Z")

</div>

field\_split is used to create a regexp character class. If you set it to "ab" then the regexp `[ab]` is used to split things. It is a string of characters to use as single-character field delimiters.

Look at replacing the field\_split option with a field\_split\_pattern option if your version of logstash supports that.

---

<div class="post-metadata">

**Author:** ![newmember](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@newmember](https://discuss.elastic.co/u/newmember)\
**Post date:** [February 12, 2021, 1:10am UTC](https://discuss.elastic.co/t/logstash-kv-field-split-regex/264058/3 "2021-02-12T01:10:26Z")

</div>

> [@Badger](#):
>
> field\_split\_pattern

Cool, my luck field\_split\_pattern was added after version 2.4.o

Thank you

---

<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:** [March 12, 2021, 1:10am UTC](https://discuss.elastic.co/t/logstash-kv-field-split-regex/264058/4 "2021-03-12T01:10:55Z")

</div>

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