# After creating new config file and run it copy also old config file data in newly created index

**URL:** <https://discuss.elastic.co/t/after-creating-new-config-file-and-run-it-copy-also-old-config-file-data-in-newly-created-index/310669>\
**Category:** Logstash\
**Created:** [July 26, 2022, 4:54pm UTC](https://discuss.elastic.co/t/after-creating-new-config-file-and-run-it-copy-also-old-config-file-data-in-newly-created-index/310669 "2022-07-26T16:54:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbkunbi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bbkunbi/32/107767_2.png) [@bbkunbi](https://discuss.elastic.co/u/bbkunbi)\
**Post date:** [July 26, 2022, 4:54pm UTC](https://discuss.elastic.co/t/after-creating-new-config-file-and-run-it-copy-also-old-config-file-data-in-newly-created-index/310669/1 "2022-07-26T16:54:38Z")

</div>

Initially i have created **c10.conf** file it store csv data in recordv2 index it is working fine. After that i have created new configuration file **gmrtant.conf** to read multiple csv file to read new data which is different than old csv file. Now if i run new config file it store new data as well as old csv data in newly created index. (snapshot is attached which contain old csv data in new file in index.)

 ![Screenshot from 2022-07-26 22-23-36](https://us1.discourse-cdn.com/elastic/original/3X/5/f/5fbe02ef8fc16f504462cf0513a352bdab536645.png)

Old config file: c10.conf f

* * *

input {  
file {  
path =\> "/home/bhaveshk/record.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}

filter {  
csv {  
columns =\> [  
"name",  
"salary",  
"age",  
"antname"  
]  
separator =\> ","

```
    }

mutate {convert => ["salary", "float"]}
mutate {convert => ["age", "float"]}
mutate {convert => ["antname", "string"]}

mutate {remove_field => ["message"]}

```

}

## output { elasticsearch { hosts =\> "localhost:9200" index =\> "recordv2" } stdout { codec =\> rubydebug } }

## New Config file: gmrtant.conf

input {  
file {  
path =\> "/home/bhaveshk/csv\_logstash/\*.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}

filter {  
csv {  
columns =\> [  
"date",  
"Hostname",  
"az\_motor\_current",  
"el\_motor\_current",  
"wind1",  
"wind2"  
]  
separator =\> ","  
skip\_header =\> "true"

```
    }
date {
    match => ["date", "dd-MM-YY"]
    target => "date"
}
 mutate {convert => ["az_motor_current", "float"]}
 mutate {convert => ["el_motor_current", "float"]}
 mutate {convert => ["wind1", "integer"]}
 mutate {convert => ["wind2", "integer"]}
 
 mutate {remove_field => ["message","@timestamp","path","host","@version"]}

```

}

output {  
elasticsearch {  
hosts =\> "localhost:9200"  
index =\> "cwsant1"  
}  
stdout { codec =\> rubydebug}

}

---

<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 23, 2022, 4:55pm UTC](https://discuss.elastic.co/t/after-creating-new-config-file-and-run-it-copy-also-old-config-file-data-in-newly-created-index/310669/2 "2022-08-23T16:55:02Z")

</div>

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