[SOLVED]How to remove agent.* and ecs.version?

If this feature exists, it's a hidden undocumented feature so I think it's safe to assume it doesn't exists.
Make sense, those fields are part of the basic functionality of the Beats. You'll break a bunch of stuff by dropping them. But I have to assume you have a custom setup already and are not using any of the features that use those fields.