Jq: ignore empty content

This commit is contained in:
andig 2024-12-24 11:02:34 +01:00
parent 8a4108cf9b
commit 541541b595

View file

@ -184,6 +184,10 @@ func (p *Pipeline) Process(in []byte) ([]byte, error) {
}
if p.jq != nil {
// TODO make this optional
if len(bytes.TrimSpace(b)) == 0 {
return b, nil
}
v, err := jq.Query(p.jq, b)
if err != nil {
return b, backoff.Permanent(err)