Since ADF does not automatically log the iteration parameters of a ForEach activity, you need to implement custom logging within your activities. You can create an Azure Function or Logic App to log the necessary information, including any parameters and values you want to track, to your Log Analytics Workspace.
Within your ForEach activity, before or after the Copy activity, add a Web activity that calls your Azure Function or Logic App. Pass the iteration parameters to this Web activity. This way, each iteration of the ForEach loop will log its parameters via the Azure Function or Logic App.
Within your Azure Function or Logic App, use the Azure Monitor Data Collector API to log the details you're interested in. This involves making an HTTP POST request to the API endpoint with the log data, including your ForEach iteration parameters.
Once your custom logs are in place, you can use KQL to query them :
| where ActivityName_s == "CopyActivityName"
| project ForEachParameter_s, ActivityRunId_s, TimeGenerated, OtherDetails_s
| order by TimeGenerated desc