I want to execute select * from table1
, select * from table2
, select * from table3
,...select * from table80
....(Basically extract data from 80 different tables and send the data to 80 different indexes in Elasticsearch(Kibana).
Is it possible for me to give multiple select * statement
in one Query Database Table and then route it to different indexes? If yes, what will be the flow like?
There are a couple approaches you can take to solve this issue.
table1
, table2
, etc., you can simply generate 80 flowfiles, each with a unique integer value in an attribute (i.e. table_count
) and use GenerateTableFetch
and ExecuteSQL
to create the queries using this attribute via Expression Languageusers
, addresses
, etc.), you can read from a file listing each on a line or use ListDatabaseTables
to query the database for the names. You can then perform simple text processing to split the created flowfile(s) to one per table and continue as above