I don't know of a way to configure it dynamically like this. Rules are quite limited in that sense.
Depending on your needs, what you can do though, is to either use a Lambda action and write values to Timestream more dynamically using for example boto3 and python (or equivalents in other languages), and if you can accept some latency AND you have a heavy workload, I'd recommend to put Kinesis stream in between IoT and lambda. A full setup would look like this:
IoT Rule -> SQL: Select * from /iot/data/#
-> IoT Rule: AWS Kinesis
Next, setup AWS Lambda as Kinesis stream consumer
And, in Lambda: Batch write to timestream tables based on the data.
What you can also try to do (I don't know off the top of my head if that'd work) is to use:
SELECT *, topic(2) as idx from /iot/data/#
to get a reference to the last segment of your topic as a value in the payload. If I remember correctly topic(n)
is 0 based, but simply confirm it before usage