# Logstash & Elasticsearch - Inserting / Updating data

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-inserting-updating-data/15534>\
**Category:** Elasticsearch\
**Created:** [January 31, 2014, 5:35pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-inserting-updating-data/15534 "2014-01-31T17:35:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Moreno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrian_moreno/32/1837_2.png) [@Adrian\_Moreno](https://discuss.elastic.co/u/Adrian_Moreno)\
**Post date:** [January 31, 2014, 5:35pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-inserting-updating-data/15534/1 "2014-01-31T17:35:44Z")

</div>

I'm testing out Logstash and ElasticSearch on my local dev (Win 7) as a  
replacement for our current SQL Server based search pages.

I'm using the current Logstash config to import a folder full of CSV files  
(pipe delimited) into ElasticSearch:

* * *

input {  
stdin {  
type =\> "stdin-type"  
}

file {  
path =\> ["C:/Users/.../export.csv"]  
}  
}

filter {  
csv {  
columns =\>  
["property\_id","postal\_code","status\_id","address\_1","city","state"]  
separator =\> "|"  
}  
}

## output { elasticsearch { embedded =\> true index =\> "assets" index\_type =\> "asset" } }

1. Sometimes it imports, sometime it doesn't. I've deleted the .sincedb  
files over and over and have changed the index name to make sure it's going  
in correctly (when it actually runs the import). Any idea why it's sporadic?

2. I have a data set of over a million records.the "\_id" value of each  
record in ES is, of course, a unique string. If I add a new CSV file with  
updates for 100 records, how does Logstash or ES know how to match an  
update to an existing record? In the original data set, the "property\_id"  
value is the primary key.

I looked  
at [http://logstash.net/docs/1.3.3/outputs/elasticsearch#document\_id](http://logstash.net/docs/1.3.3/outputs/elasticsearch#document_id) , which  
seems to be the correct setting for the import, but what value? I tried  
"property\_id", the first column name, but that doesn't work. The import  
doesn't even run with that setting.

Any help would be appreciated. Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ca71517f-f950-4d63-9340-57acf35e45f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ca71517f-f950-4d63-9340-57acf35e45f6%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 1:53am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-inserting-updating-data/15534/2 "2017-07-06T01:53:37Z")

</div>


