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

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.)

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}

}

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