Well test it out... Let us know...
Are you using standalone or fleet managed?
It's not really the approach I'm taking... What I gave you is a manageable scalable approach... Which can literally be set up in about 5 minutes and then start testing...
You can test the ingest pipeline using the _simulate API too...
I find debugging the agent.yml much harder than just the custom pipelines...
That said, there's always more than one way to do things..
I think it may be possible but your syntax is most likely not correct...
I don't know what the correct syntax would be off hand
I do think there's a conditional pipeline but it needs to go with an index or something to that effect. What affect that has on the Data Stream Name I am not sure...
It's using filebeat somewhat under the covers....
Maybe look at this.