elastic / integrations

Elastic Integrations
https://www.elastic.co/integrations
Other
194 stars 421 forks source link

Incorrect logic for checking if tags contains 'forwarded' #1773

Closed andrewkroh closed 2 years ago

andrewkroh commented 2 years ago

Packages use a Handlebar template function to check if tags contains forwarded as a value. But they put the arguments to the function in the wrong order. The function is defined at https://github.com/elastic/kibana/blob/fd0c1fa490c2e4eab5a3cbc96c8f3703cc4962f6/x-pack/plugins/fleet/server/services/epm/agent/agent.ts#L114.

The impact is that when tags contains more than just [forwarded] then host.name of the Agent is included rather than allowing the forwarded host.name value to pass through.

CORRECT Usage:

{{#contains "forwarded" tags}}

WRONG:

{{#contains tags "forwarded"}}

Affected Integrations

andrewkroh commented 2 years ago

This was fixed by a series of PRs. https://github.com/elastic/integrations/search?q=Fix+contains+check+for+forwarded+tag&type=issues