Elastic Agent Enroll

Good Day.

Do not tell me by chance whether it is possible to add any custom field to the elastic agent, where I can leave a record when installing the agent and work with it when searching (it seems that this is impossible)

Target:
when installing the agent, you must specify the user who is on the machine
(hostname, users, etc. do not match [invalid search data])

considered working with environment variables, but I can't find information on how to read the value of the variable from the agent