# Split field into multiple fields

**URL:** https://discuss.elastic.co/t/split-field-into-multiple-fields/284096
**Category:** Logstash
**Created:** [September 13, 2021, 3:34pm UTC](https://discuss.elastic.co/t/split-field-into-multiple-fields/284096 "2021-09-13T15:34:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mavericknd](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@mavericknd](https://discuss.elastic.co/u/mavericknd)
#### Post date: [September 13, 2021, 3:34pm UTC](https://discuss.elastic.co/t/split-field-into-multiple-fields/284096/1 "2021-09-13T15:34:54Z")

</div>

Hi,

i have the following log and want the key value pairs inside message (ipAddress=1.1.1.1 realmId=some\_realm) to be separate fields. I tried with grok, kv, mutate, nothing works, no change in kibana.  
If somebody can help, please.  
@timestamp: Sep 13, 2021 @ 14:43:38.265 @version: 1 @version.keyword: 1 facility: logstash-gelf  
facility.keyword: logstash-gelf host: etcd1 host.keyword: etcd1 level: 4 LoggerName: org.keycloak.events LoggerName.keyword: org.keycloak.events message: type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=192.168.3.6, error=expired\_code, restart\_after\_timeout=true, authSessionParentId=fab5767d-8c66-47cd-9479-3b2c6e8bbfd2, authSessionTabId=kGyxYwuAu6I message.keyword: type=LOGIN\_ERROR, realmId=master, clientId=null,

---

<div class="post-metadata">

### Author: ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)
#### Post date: [September 14, 2021, 8:22pm UTC](https://discuss.elastic.co/t/split-field-into-multiple-fields/284096/2 "2021-09-14T20:22:41Z")

</div>

> [@mavericknd](#):
>
> type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=192.168.3.6, error=expired\_code, restart\_after\_timeout=true, authSessionParentId=fab5767d-8c66-47cd-9479-3b2c6e8bbfd2, authSessionTabId=kGyxYwuAu6I message.keyword: type=LOGIN\_ERROR, realmId=master, clientId=null

The [kv](https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html) filter should take care of this.

`filter { kv { field_split_pattern => ", " } }`

---

<div class="post-metadata">

### Author: ![mavericknd](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@mavericknd](https://discuss.elastic.co/u/mavericknd)
#### Post date: [September 17, 2021, 7:02am UTC](https://discuss.elastic.co/t/split-field-into-multiple-fields/284096/3 "2021-09-17T07:02:50Z")

</div>

Unfortunately it doesn't work. Not even with ",\s"

---

<div class="post-metadata">

### Author: ![mavericknd](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@mavericknd](https://discuss.elastic.co/u/mavericknd)
#### Post date: [September 17, 2021, 2:14pm UTC](https://discuss.elastic.co/t/split-field-into-multiple-fields/284096/4 "2021-09-17T14:14:29Z")

</div>

i managed to make it work. I had a typo

---

<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: [October 15, 2021, 2:14pm UTC](https://discuss.elastic.co/t/split-field-into-multiple-fields/284096/5 "2021-10-15T14:14:38Z")

</div>

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