# Remove text on field

**URL:** https://discuss.elastic.co/t/remove-text-on-field/141189
**Category:** Logstash
**Created:** [July 23, 2018, 2:03pm UTC](https://discuss.elastic.co/t/remove-text-on-field/141189 "2018-07-23T14:03:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sysdradmin](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@sysdradmin](https://discuss.elastic.co/u/sysdradmin)
#### Post date: [July 23, 2018, 2:03pm UTC](https://discuss.elastic.co/t/remove-text-on-field/141189/1 "2018-07-23T14:03:05Z")

</div>

hello,  
I have a csv file like this

2018-07-17 06:01:18 ID:784514|FD: ....  
As you can see it's missing a "|" between date/time and ID so first field is saw like a text

I want that first field is a date/time and other field like 'id'

How i can they to logstast to put first field in date/time and ID like a other field ?

rgds

---

<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: [July 23, 2018, 2:35pm UTC](https://discuss.elastic.co/t/remove-text-on-field/141189/2 "2018-07-23T14:35:16Z")

</div>

Insert the |, then use a csv filter

```
mutate { gsub => ["message", "^([^]+ [^]+) ", "\1|" ] }
```

---

<div class="post-metadata">

### Author: ![sysdradmin](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@sysdradmin](https://discuss.elastic.co/u/sysdradmin)
#### Post date: [July 23, 2018, 2:40pm UTC](https://discuss.elastic.co/t/remove-text-on-field/141189/3 "2018-07-23T14:40:17Z")

</div>

ths for reply :

i have done this :

mutate {

split =\> { "message" =\> "ID:" }  
add\_field =\> {  
"TimeStamp" =\> "%{[message][0]}"  
"ID" =\> "%{[message][1]}"

}

and seems working

---

<div class="post-metadata">

### Author: ![sysdradmin](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@sysdradmin](https://discuss.elastic.co/u/sysdradmin)
#### Post date: [July 23, 2018, 2:48pm UTC](https://discuss.elastic.co/t/remove-text-on-field/141189/4 "2018-07-23T14:48:52Z")

</div>

but i don't have \_source with all fields

ideas ?

---

<div class="post-metadata">

### Author: ![sysdradmin](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@sysdradmin](https://discuss.elastic.co/u/sysdradmin)
#### Post date: [July 23, 2018, 3:31pm UTC](https://discuss.elastic.co/t/remove-text-on-field/141189/5 "2018-07-23T15:31:48Z")

</div>

thanks !

it's better

---

<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: [August 20, 2018, 3:32pm UTC](https://discuss.elastic.co/t/remove-text-on-field/141189/6 "2018-08-20T15:32:07Z")

</div>

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