My test json file is as follows:

   "security/path": "/var/log/systems.log"

I would like to filter by key security/path, and below commands all don't work.

jq .security/path test.json
jq: error: path/0 is not defined at <top-level>, line 1:
jq: 1 compile error

jq '.security/path' test.json has same result.

1 Answer 1


From Basic filters:

Object Identifier-Index:


If the key contains special characters or starts with a digit, you need to surround it with double quotes like this: ."foo$", or else .["foo$"]



$ jq '."security/path"' test.json

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.