# Logstash is indexing the last line of my csv file in elasticsearch

**URL:** <https://discuss.elastic.co/t/logstash-is-indexing-the-last-line-of-my-csv-file-in-elasticsearch/2584>\
**Category:** Logstash\
**Created:** [June 12, 2015, 3:32pm UTC](https://discuss.elastic.co/t/logstash-is-indexing-the-last-line-of-my-csv-file-in-elasticsearch/2584 "2015-06-12T15:32:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hamza\_Chtioui](https://avatars.discourse-cdn.com/v4/letter/h/c37758/32.png) [@Hamza\_Chtioui](https://discuss.elastic.co/u/Hamza_Chtioui)\
**Post date:** [June 12, 2015, 3:32pm UTC](https://discuss.elastic.co/t/logstash-is-indexing-the-last-line-of-my-csv-file-in-elasticsearch/2584/1 "2015-06-12T15:32:36Z")

</div>

Holà,

I'm new in Elasticsearch,  
today i'm trying to index data from a csv file.  
I learn from the net that i can use Logstash to do this..

this is my conf file:

```
input {  
      file {
          path => "C:\plus\csv_16548461567_vp.csv"
          type => "Sample"
          start_position => "beginning"
      }
}

filter {  
    csv {
        columns => ["Numero de commande","Type revendeur","Enseigne","Chef de secteur","compte","Nom du Revendeur","Campagne","Type de client","Profil de client","Nom du client","Date","Mois","Total Avant RemiseHt","Total Avant RemiseTTC","Remise Ht","Remise TTC","Remise Remboursee Ht","Remise Remboursee Nikon TTC","TVA"]
        separator => ";"
    }
}

output {  
    elasticsearch {
        action => "index"
        host => "localhost"
        index => "financier-v2"
        document_id => "%{property_id}"
    }
}

```

I can't figure out why i have only one data in Elasticsearch??  
I used Kibana to visualise data.. but i see **only the last line of my csv file**.

How can i fix this??

Thanks

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 12, 2015, 4:23pm UTC](https://discuss.elastic.co/t/logstash-is-indexing-the-last-line-of-my-csv-file-in-elasticsearch/2584/2 "2015-06-12T16:23:48Z")

</div>

It looks like you are trying to set the document\_id based a field that does not exist ('property\_id'), meaning that the same ID might be used for all lines in the file, resulting in the same document getting updated over and over. What is the \_id of the document in Kibana?

---

<div class="post-metadata">

**Author:** ![Hamza\_Chtioui](https://avatars.discourse-cdn.com/v4/letter/h/c37758/32.png) [@Hamza\_Chtioui](https://discuss.elastic.co/u/Hamza_Chtioui)\
**Post date:** [June 12, 2015, 4:28pm UTC](https://discuss.elastic.co/t/logstash-is-indexing-the-last-line-of-my-csv-file-in-elasticsearch/2584/3 "2015-06-12T16:28:22Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> It looks like you are trying to set the document\_id based a field that does not exist ('property\_id'), meaning that the same ID might be used for all lines in the file, resulting in the same document getting updated over and over. What is the \_id of the document in Kibana?

Thanks for the quick reply,  
i added this line:

```
document_id => "%{property_id}"

```

I thougnt that it can help for structuring my data..  
Because when i remove it, logstash indexes my data without respecting the columns that i mention in the conf file...

---

<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, 5:37am UTC](https://discuss.elastic.co/t/logstash-is-indexing-the-last-line-of-my-csv-file-in-elasticsearch/2584/4 "2017-07-06T05:37:32Z")

</div>


