# CSV import - import data + import relatioship between data

**URL:** https://discuss.elastic.co/t/csv-import-import-data-import-relatioship-between-data/138000
**Category:** Logstash
**Created:** [June 29, 2018, 3:10pm UTC](https://discuss.elastic.co/t/csv-import-import-data-import-relatioship-between-data/138000 "2018-06-29T15:10:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lvboque](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@lvboque](https://discuss.elastic.co/u/lvboque)
#### Post date: [June 29, 2018, 3:10pm UTC](https://discuss.elastic.co/t/csv-import-import-data-import-relatioship-between-data/138000/1 "2018-06-29T15:10:15Z")

</div>

For a project, I am importing data of person in a database (id, first name, last name, ...). I am using logstash for that using configuration file like this one .... (see below).

Then, I would like to import a parent/child relationship. I have simple csv files mapping parent id to child id.

Later on, I would like to produce nice parent/child graph .... Is it possible? How to can import the relationship csv file using logstash?

Thanks a lot for your support,

_input {_  
\_ file {\_  
\_ path =\> "/tmp/data/\*_req.csv.csv"_  
\_ start\_position =\> "beginning"\_  
\_ sincedb\_path =\> "/dev/null"\_  
\_ }\_  
\_ stdin {\_  
\_ codec =\> multiline {\_  
\_ pattern =\> "^/"\_  
\_ what =\> "next"\_  
\_ }\_  
\_ }\_  
_}_  
_filter {_  
\_ csv {\_  
\_ separator =\> ";"\_  
\_ columns =\> ["UID","PUID","IBA Feature","IBA Applicable Platform","Created By","Created On","Level","Object Text"]\_  
\_ }\_  
\_ mutate {convert =\> ["Level", "integer"] }\_  
_}_  
_output {_  
\_ elasticsearch {\_  
\_ hosts =\> ["0.0.0.0:9200"]\_  
\_ index =\> "doors"\_  
\_ document\_type =\> "requirements"\_  
\_ }\_  
_}_

---

<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 27, 2018, 3:10pm UTC](https://discuss.elastic.co/t/csv-import-import-data-import-relatioship-between-data/138000/2 "2018-07-27T15:10:21Z")

</div>

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