# Problem when importing a CSV file

**URL:** <https://discuss.elastic.co/t/problem-when-importing-a-csv-file/226627>\
**Category:** Logstash\
**Created:** [April 6, 2020, 6:24am UTC](https://discuss.elastic.co/t/problem-when-importing-a-csv-file/226627 "2020-04-06T06:24:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GuyMuller](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@GuyMuller](https://discuss.elastic.co/u/GuyMuller)\
**Post date:** [April 6, 2020, 6:24am UTC](https://discuss.elastic.co/t/problem-when-importing-a-csv-file/226627/1 "2020-04-06T06:24:55Z")

</div>

Good morning, sir,  
When importing, the columns described in the Filter section were not taken into account.  
They are all in column 1!?!

> Blockquote

```
    filter {

        csv { 

            separator => ","

            columns => ["GROUPE,CODE,TITRE,SOCIETE,PRENOM,COMPLEMENT,NP,ADRESSE,VILLE,LONGITUDE,LATITUDE,REPRESENTANT,CODE_DEPOT,PICOD,PINO,FACTURE,ANNEE,TRIMESTRE,MOIS,DATE_FACT,REFERENCE,DESIGNATION,OP,SERIE,QUANTITE,QUANTITE,TOTAL_HT,TRANSPORT"]

            }

    }![Capture1|690x175](upload://ro0Z9ImS7SMc61sDzdrAxcM4udh.jpeg) ![Capture2|291x500](upload://ghvtf2H2NhZtKTDzD22DVBf5gnQ.jpeg) 

```

> Blockquote

see capture1  
.  
Other remarks, did the numerical data remain in text format?  
see capture2

Thank you in advance for your help  
G. Muller

 ![Capture1](https://us1.discourse-cdn.com/elastic/original/3X/b/f/bff1ad300136b696a9a8331c55ce8ed5a42cfe4f.jpeg) ![Capture2](https://us1.discourse-cdn.com/elastic/original/3X/7/2/721d6c78c1cceae3b019fe02f4e0ca65b3a5f9ee.jpeg)

---

<div class="post-metadata">

**Author:** ![Robo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robo/32/38295_2.png) [@Robo](https://discuss.elastic.co/u/Robo)\
**Post date:** [April 6, 2020, 6:48am UTC](https://discuss.elastic.co/t/problem-when-importing-a-csv-file/226627/2 "2020-04-06T06:48:16Z")

</div>

is the source field "message" for csv? if not, try to define the correct one.

```auto
filter {
        csv {
            source => "source_field" 
            separator => ","
            columns => ["GROUPE,CODE,TITRE,SOCIETE,PRENOM,COMPLEMENT,NP,ADRESSE,VILLE,LONGITUDE,LATITUDE,REPRESENTANT,CODE_DEPOT,PICOD,PINO,FACTURE,ANNEE,TRIMESTRE,MOIS,DATE_FACT,REFERENCE,DESIGNATION,OP,SERIE,QUANTITE,QUANTITE,TOTAL_HT,TRANSPORT"]
            }
    }

```

For numeric fields add convert:  
[https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html#plugins-filters-csv-convert](https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html#plugins-filters-csv-convert)

---

<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:** [May 4, 2020, 6:48am UTC](https://discuss.elastic.co/t/problem-when-importing-a-csv-file/226627/3 "2020-05-04T06:48:21Z")

</div>

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