diff --git a/docs/synapse/userguides/storm_ref_lift.ipynb b/docs/synapse/userguides/storm_ref_lift.ipynb index 98b9825ef8..e2767ead10 100644 --- a/docs/synapse/userguides/storm_ref_lift.ipynb +++ b/docs/synapse/userguides/storm_ref_lift.ipynb @@ -48,6 +48,7 @@ "Lift operations retrieve a set of nodes from a Synapse Cortex based on specified criteria. While all lift operations are retrieval operations, they can be broken down into “types” of lifts based on the criteria, comparison operator, or special handler used:\n", "\n", "- `Simple Lifts`_\n", + "- `Try Lifts`_\n", "- `Lifts Using Standard Comparison Operators`_\n", "- `Lifts Using Extended Comparison Operators`_\n", "\n", @@ -623,6 +624,170 @@ "_ = await core.fini()" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true + }, + "outputs": [], + "source": [ + "# Create a cortex for the Safe Lifts section\n", + "core = await getTempCoreCmdr()" + ] + }, + { + "cell_type": "raw", + "metadata": { + "hideCode": false + }, + "source": [ + "Try Lifts\n", + "---------\n", + "\n", + "Try lifts refer to lifts that \"try\" to perform a Cortex lift operation, and fail silently if :ref:`data-type` normalization is not successful. Try lifts prevent a Cortex from throwing a runtime execution error, and terminating query execution if an invalid Type is encountered.\n", + "\n", + "When lifting nodes by property value using the equals (``=``) comparator, if Type validation fails for a supplied property value, the Cortex will throw a ``BadTypeValu`` error, and terminate the query as shown below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": false + }, + "outputs": [], + "source": [ + "# Make a FQDN, MD5, IPv4, and email nodes:\n", + "q = '[ inet:fqdn=evil.com inet:dns:a=(evil.com,192.168.0.100) hash:md5=174cc541c8d9e1accef73025293923a6 inet:ipv4=8.8.8.8 inet:email=jane@goodgirl.com inet:email=jack@soso.net]'\n", + "# Execute query and test\n", + "podes = await core.eval(q, num=6, cmdr=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": false, + "hidePrompt": false + }, + "outputs": [], + "source": [ + "# Define and print test query\n", + "q = 'inet:ipv4 = evil.com inet:ipv4 = 8.8.8.8'\n", + "# Execute the query and test\n", + "podes = await core.storm(q, num=0, cmdr=True, suppress_logging=True)" + ] + }, + { + "cell_type": "raw", + "metadata": { + "hidePrompt": false + }, + "source": [ + "To suppress errors, and prevent premature query termination, Storm supports the use of the try operator (``?=``) when performing property value lifts. This operator is useful when you are performing multiple Cortex operations in succession within a single query, lifting nodes using external data that has not been normalized, or lifting nodes during automation, and do not want a query to terminate if an invalid Type is encountered.\n", + "\n", + "\n", + "**Syntax:**\n", + "\n", + "*