Skip to main content

JSONpath

Learn how to use the SailPoint CLI to evaluate JSONpath queries in this guide.

JSONpath is a language for querying data in a JSON object.

The jsonpath command makes it easy to evaluate JSONpath queries from within the SailPoint CLI. At this time, the jsonpath command only supports the workflows JSONpath operators documented here.

  • evaluate

    Evaluate JSONpath

    Run this command to evaluate a JSONpath query:

    sail jsonpath eval -f /path/to/object.json -p "$.path"

    File path

    The first flag you must append when you are evaluating JSONpath queries is the --file (-f for short) flag. This flag specifies the file path for a JSON object that you want to use as a test for your query.

    Here is what the command looks like with the -f flag:

    sail jsonpath eval -f /path/to/object.json

    Path

    The second flag you must append when you are evaluating JSONpath queries is the --path (-p for short) flag. This flag specifies the path you want to evaluate against the JSON object.

    Here is what the command looks like with the -p flag:

    sail jsonpath eval -f /path/to/object.json -p "$.path"

    This will show the result of the path expression in the terminal.