Dynamic naming of elasticsearch data-streams

I'm not sure this is the same issue.

The error message says:

elasticsearch - Badly formatted index, after interpolation still contains placeholder: [logs-%{facility}-prod]

Do you have the field facility and @metadata.dataset in all documents?

Can you share an example of a document you have in logstash? use a stdout output to get it.