Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filebeat][httpjson input] Unable to create body with single value list #25060

Closed
P1llus opened this issue Apr 14, 2021 · 4 comments · Fixed by #25074
Closed

[Filebeat][httpjson input] Unable to create body with single value list #25060

P1llus opened this issue Apr 14, 2021 · 4 comments · Fixed by #25074

Comments

@P1llus
Copy link
Member

P1llus commented Apr 14, 2021

Follow-up from discussion here https://discuss.elastic.co/t/header-transform-concern-need-help/269064/19.

There does not seem to be any good way or workaround to create a body with a single value list.

The append documentation states:
https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-httpjson.html#_append
Appends a value to a list. If the field does not exist, the first entry will be a scalar value, and subsequent additions will convert the value to a list.

Relevant code is here: https://github.com/elastic/beats/blob/master/x-pack/filebeat/input/httpjson/internal/v2/transform_append.go#L136

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 14, 2021
@P1llus
Copy link
Member Author

P1llus commented Apr 14, 2021

We could either change the default behavior, or we would need some config option for this, is there a reason why the first value is not a list when using append compared to set, WDYT @marc-gr ?

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 14, 2021
@legoguy1000
Copy link
Contributor

@P1llus the original poster in discuss had created an issue for this, #24952. I would close one so there's not duplicates.

@marc-gr
Copy link
Contributor

marc-gr commented Apr 14, 2021

We could either change the default behavior, or we would need some config option for this, is there a reason why the first value is not a list when using append compared to set, WDYT @marc-gr ?

Was a matter of consistency with append processor, which works like this. Truth is that the append transform is not only meant to send data to ES so this behavior might be not the expected one. I am fine with either (or both) changing the default behavior to always create a list, or to allow set to have list values as suggested in #24952. The first would be considered a breaking change though, so maybe is safer to err on the safe side if we were not considering the current behavior a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants