Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 888 Bytes

README.md

File metadata and controls

25 lines (21 loc) · 888 Bytes

gfilter

Filter JSON lines with GJSON query syntax.

$ go install .

$ gfilter --help
Usage of gfilter:
  -match-all string
        match all of these properties (gjson syntax, comma separated queries)
  -match-any string
        match any of these properties (gjson syntax, comma separated queries)
  -match-none string
        match none of these properties (gjson syntax, comma separated queries)

$ cat <<EOF | gfilter --match-all '#(age>42),#(name.last=="Smith")'
{"name":{"first":"Janet","last":"Prichard"},"age":47}
{"name":{"first":"Carol","last":"Smith"},"age":49}
{"name":{"first":"John","last":"Smith"},"age":42}
{"name":{"first":"Lisa","last":"Smith"},"age":49}
EOF
{"name":{"first":"Carol","last":"Smith"},"age":49}
{"name":{"first":"Lisa","last":"Smith"},"age":49}