# Rename fieldnames based on an import configuration table

**URL:** <https://discuss.elastic.co/t/rename-fieldnames-based-on-an-import-configuration-table/223938>\
**Category:** Logstash\
**Created:** [March 17, 2020, 1:40pm UTC](https://discuss.elastic.co/t/rename-fieldnames-based-on-an-import-configuration-table/223938 "2020-03-17T13:40:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pascal\_Rheinert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pascal_rheinert/32/64586_2.png) [@Pascal\_Rheinert](https://discuss.elastic.co/u/Pascal_Rheinert)\
**Post date:** [March 17, 2020, 1:40pm UTC](https://discuss.elastic.co/t/rename-fieldnames-based-on-an-import-configuration-table/223938/1 "2020-03-17T13:40:20Z")

</div>

I have cassandra database with two tables "products" and "fields".  
The product table consists of the following fields: "ID", "1:Value", "2:Value", .. "99:Value"  
Example:  
"ID", "1:Value", "2:Value", "3:Value"  
1, Test, 23, TestA  
2, Test-2, 24, TestA-2

The fields table consists of "fieldID", "fieldname"  
Example:  
1, "Method"  
2, "Number"  
3, "Alternative"

I now want to export the "products" table into a csv file - but renaming the fields based on the definition in table "fields" (also the names should be changed).  
The export should look like  
"ID", "Method", "Number", "Alternative"  
1, Test, 23, TestA  
2, Test-2, 24, TestA-2

What is the right way to do so?  
Using jdbc\_static?  
Or ruby-code?  
The problem is that the number of fields is flexible... And I do not know how to get field names as another "input" (apart from jdbc\_static or jdb\_streaming - but both of them tend rather to be used as "foreign key - values" instead of renaming of fieldnames)

Thanks so much!  
Pascal

---

<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:** [April 14, 2020, 1:40pm UTC](https://discuss.elastic.co/t/rename-fieldnames-based-on-an-import-configuration-table/223938/2 "2020-04-14T13:40:27Z")

</div>

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