JDBC input type "store output into single field"

Hi,

I am using jdbc input type and execute the oracle query, is it possible to store query output into a single variable/field ?

Query Output : -
ID

100
101
102

Above output store into three different JSON into elastic, but I am looking single JSON with all query output into single field.

Option A: Configure an input that only emits a single event, e.g. JDBC with a query that returns nothing but the latest ID, so you have a starting point. Then use a Jdbc_streaming filter for the actual query that returns multiple rows. Then there would be only one result with all the rows in one field. In the last step one could restructure the fields with Ruby as one pleases.
Option B: Execute your usual query that returns multiple events. Use an aggregate filter and in the code for the aggregation you would append the current event's ID to an array of IDs in the aggregation map and cancel the event. Then you would either need a timeout or a condition to detect when to push the map data as an event.

Thanks

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