Indexing multiple csv files into one index with nested fields

I want to load data from multiple CSV files(Users, Scores, Messages) into one index via logstash.
All CSV files have the same "userId" field that connects data in it.

My goal is to have User-Index as a result, that has the data from the User CSV file as simple fields and the data from Scores and Messages files as nested fields.

Is there a way to somehow achieve this?

One user can have multiple messages and scores.

Welcome ivandreev1618

You can use upsert and userid as the document id. After you import all 3 file types (Users, Scores, Messages) then go to Kibana and create data view.

output {
   elasticsearch {
      hosts => ["http://localhost:9200"]
      index => "user-score-msg"
      document_id => "%{userid}"
   }
}