spath command: Examples
Examples for using the SPL2 spath command
Extracting information by specifying an output field and path
The following example shows how to specify an output field and path:
... | spath output=myfield path="server.name"
Extracting information by specifying an output field and path with a wildcard for JSON data
The following example shows how to specify an output field and path with a wildcard for JSON data:
... | spath output=commit_author path="commits{}.author.name"
Extracting the value of the locale attribute in XML data
The following example shows how to extract the value of the locale attribute in XML data. Because the output field name contains a special character, a period ( . ), the field name must be enclosed in quotation marks.
... | spath output="locDesc.locale" path="vendorProductSet.product.desc.locDesc{@locale}"
See also
spath command