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

split drops empty fields #47

Open
TheVastyDeep opened this issue Sep 20, 2023 · 1 comment
Open

split drops empty fields #47

TheVastyDeep opened this issue Sep 20, 2023 · 1 comment
Labels

Comments

@TheVastyDeep
Copy link

logstash 8.10.1 installed via rpm on AWS.

The filter drops split fields if they are empty. If the field being split is an array of empty strings then the entire event is discarded.

input { generator { count => 1 lines => [ '{ "someField": [ "", "" ] }' ] codec => json } }
output { stdout { codec => rubydebug { metadata => false } } }
filter { split{ field => "someField" } }

produces no output. This feels wrong.

@leandrojmp
Copy link

leandrojmp commented Oct 22, 2024

Just came here to report this same behavior after spending a couple of hours debugging why some events where missing from a pipeline.

Tracked it down to the split filter dropping documents where the field used was an empty array.

I used a similar pipeline to replicate it:

input {
    generator {
        lines => [
            '{"fieldName": "value1", "fieldArray": []}',
            '{"fieldName": "value2", "fieldArray": ["item1", "item2"]}'
        ]
        count => 1
    }
}
filter {
    json {
        source => "message"
    }
    split {
        field => "fieldArray"
    }
}
output {
    stdout {}
}

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

No branches or pull requests

2 participants