# How to enrich one of field in logtash

**URL:** <https://discuss.elastic.co/t/how-to-enrich-one-of-field-in-logtash/293579>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [January 5, 2022, 6:26pm UTC](https://discuss.elastic.co/t/how-to-enrich-one-of-field-in-logtash/293579 "2022-01-05T18:26:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![INS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ins/32/92827_2.png) [@INS](https://discuss.elastic.co/u/INS)\
**Post date:** [January 5, 2022, 6:26pm UTC](https://discuss.elastic.co/t/how-to-enrich-one-of-field-in-logtash/293579/1 "2022-01-05T18:26:48Z")

</div>

I'm struggling on enrich (split one of field from) CSV file input

in my document I have many of undefined fields so at the begging I've needed to  
avoid that value.  
so I've decided to use

```auto
mutate {
		gsub => ["message","undefined-",""]
	}

	mutate {
		gsub => ["message","[-]*undefined",""]
	}

```

but now I need to split one of filed from "berears"  
this expression after | it can be repeated many times  
:

```auto
5-7-undefined-undefined-undefined-undefined-undefined-#0(bearer successful)-5|
7-5-undefined-undefined-undefined-undefined-undefined-#0(bearer successful)-7;

```

according to head

```auto
EPS_BEARER_ID-BEARER_QCI-ARP_PL-ARP_PCI-ARP_PVI-GBR_UL-GBR_DL-BEARER_CAUSE-DEFAULT_BEARER_ID

```

1. how to make an exception for such a field to leave the fields undefined and match within pattern
2. how to assign a breakdown of these values to individual fields
3. is it possible to enrich after global exception (on the beginning)

---

<div class="post-metadata">

**Author:** ![INS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ins/32/92827_2.png) [@INS](https://discuss.elastic.co/u/INS)\
**Post date:** [January 10, 2022, 12:47pm UTC](https://discuss.elastic.co/t/how-to-enrich-one-of-field-in-logtash/293579/4 "2022-01-10T12:47:48Z")

</div>

if someone could take a look at this?

---

<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:** [February 7, 2022, 12:48pm UTC](https://discuss.elastic.co/t/how-to-enrich-one-of-field-in-logtash/293579/5 "2022-02-07T12:48:43Z")

</div>

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