# Add new Field in Logstash

**URL:** https://discuss.elastic.co/t/add-new-field-in-logstash/189477
**Category:** Logstash
**Created:** [July 9, 2019, 7:48am UTC](https://discuss.elastic.co/t/add-new-field-in-logstash/189477 "2019-07-09T07:48:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Syed.Ubaid](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Syed.Ubaid](https://discuss.elastic.co/u/Syed.Ubaid)
#### Post date: [July 9, 2019, 7:48am UTC](https://discuss.elastic.co/t/add-new-field-in-logstash/189477/1 "2019-07-09T07:48:56Z")

</div>

I have this csv file which look like this  
Insert Time :13/05/2019 0:00:54,  
Mobile : 923xxxxxxxxx,  
Telco: Mobilink,  
Mask : 6222  
Message : Your MCB Debit Card has been charged PKR xx

I want to find logstash the message field to find MCB Debit Card and add into new Column Card Type

I have this config file but its not running can someone help

input  
{  
file  
{  
path =\> "D:/kibanaproject/ubaid.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "NUL"  
}  
}  
filter {  
if [Message] =~ "/MCB/"{  
mutate {  
add\_field =\> {"CardType"}  
}  
csv {  
separator =\> ","  
columns =\> ["Insert\_time","Mobile","Telco","Mask","Message"]  
}  
date {  
match =\> ["Insert\_time","dd-MM-YYYY HH:mm"]  
target =\> "Insert\_time"  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "match-%{+dd.MM.YYYY}"  
}  
stdout {  
codec =\> json\_lines  
}  
}

---

<div class="post-metadata">

### Author: ![Syed.Ubaid](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Syed.Ubaid](https://discuss.elastic.co/u/Syed.Ubaid)
#### Post date: [July 9, 2019, 8:37am UTC](https://discuss.elastic.co/t/add-new-field-in-logstash/189477/2 "2019-07-09T08:37:16Z")

</div>

If i have 20 columns which contain message  
Your MCB Debit Card has been charged PKR xx 19 columns include this message  
Your OTP login is 1 column include this message  
what i want is that when message find the filter MCB Debit card in 19 columns it add single column card type and add debit against the 19 columns

---

<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 6, 2019, 8:37am UTC](https://discuss.elastic.co/t/add-new-field-in-logstash/189477/3 "2019-08-06T08:37:20Z")

</div>

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