Bulk export of several directories of csv files to elasticsearch

The csv filter has an autodetect_column_names option that probably does what you're looking for.