-
Notifications
You must be signed in to change notification settings - Fork 1
Quoting
Lowell Alleman edited this page Nov 17, 2018
·
1 revision
Special care is needed for keys that contain unusual characters or symbols that interfere with the JMESPath syntax. Fortunately, this isn't a problem for many json docs. But when it is, simply wrapping the token in question in double quotes. Keep in mind that since the entire <jmespath-string> is often already quoted to keep JMESPath and Splunk syntax separate, so the JMESPath double quotes themselves must be escaped. Don't worry. It's not that bad, take a look:
Take an example, a json doc like this:
{ "doc" : { "og:site_name": "LA Weekly" } }If you want to pull out the og:site_name value, use a command like so:
... | jmespath output=site "doc.\"og:site_name\""
Without the double quotes, the : character would cause a parsing error.
| makeresults | eval _raw="{\"doc\":{\"og:site_name\":\"LA Weekly\"}}"
| jmespath output=site "doc.\"og:site_name\""
- Introduction
- So what is JMESPath?
- What's wrong with spath?
- Command Reference
- Tutorial (Search examples)
- Change Log