Unfortunately, field aliasing is one-to-one, and won't allow you to map many-to-one. The reason is that if orig_field doesn't exist, a blank value will be assigned to new_field.
Consider an event that has only the acct field. Both FIELDALIAS directives will be evaluated. Lexicographically, FIELDALIAS-acct runs first and successfully aliases acct as account. But when FIELDALIAS-username runs it finds no User_Name field, so the result is the account field will be blank.
There are two ways to work around this.
Use props.conf:
REPORT-alias_account = acct_as_account,User_Name_as_account
and transforms.conf:
[acct_as_account]
SOURCE_KEY = acct
REGEX = (?<account>.+)
[User_Name_as_account]
SOURCE_KEY = User_Name
REGEX = (?<account>.+)
Use the search language:
| eval account= IF(ISNULL(acct),User_Name,acct)
... View more